Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
Signed-off-by: dsayan154 <dsayan154@gmail.com>
  • Loading branch information
dsayan154 committed Oct 7, 2020
2 parents 29971ca + a7b2a44 commit 7293c9d
Show file tree
Hide file tree
Showing 13 changed files with 320 additions and 35 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ all relevant information as template suggest.
* If you have a quick question you might want to also ask on #thanos or #thanos-dev slack channel in the CNCF workspace.
We are recommending, using GitHub issues for issues and feedback, because GitHub issues are track-able.

If you encounter security vulnerability, please refer to [Reporting a Vulnerability process](SECURITY.md)
If you encounter security vulnerability, please refer to [Reporting a Vulnerability process](/SECURITY.md)

## Adding New Features / Components

When contributing not obvious change to Thanos repository, please first
discuss the change you wish to make via issue or slack, or any other
method with the owners of this repository before making a change.

Adding a large new feature or/and component to Thanos should be done by first creating a [proposal](docs/proposals) document outlining the design decisions of the change, motivations for the change, and any alternatives that might have been considered.
Adding a large new feature or/and component to Thanos should be done by first creating a [proposal](/docs/proposals) document outlining the design decisions of the change, motivations for the change, and any alternatives that might have been considered.

## General Naming

Expand All @@ -46,7 +46,7 @@ In the code and documentation prefer non-offensive terminology, for example:

## Components Naming

Thanos is a distributed system composed with several services and CLI tools as listed [here](cmd/thanos).
Thanos is a distributed system composed with several services and CLI tools as listed [here](/cmd/thanos).

When we refer to them as technical reference we use verb form: `store`, `compact`, `rule`, `query`. This includes:

Expand Down
2 changes: 2 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Feel free to contact us (preferably on Slack) anytime for feedback, questions or

Especially feedback, please share if you have ideas what we can do better!

You can reach us under `thanos-io@googlegroups.com` email.

## Triage

We also have some nice souls that help triaging issues and PRs. See [here](https://help.github.com/en/articles/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)
Expand Down
2 changes: 1 addition & 1 deletion docs/components/compact.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Keep in mind, that the initial goal of downsampling is not saving disk space (Re

To avoid confusion - you might want to think about `raw` data as about "zoom in" opportunity. Considering the values for mentioned options - always think "Will I need to zoom in to the day 1 year ago?" if the answer "yes" - you most likely want to keep raw data for as long as 1h and 5m resolution, otherwise you'll be able to see only downsampled representation of how your raw data looked like.

There's also a case when you might want to disable downsampling at all with `debug.disable-downsampling`. You might want to do it when you know for sure that you are not going to request long ranges of data (obviously, because without downsampling those requests are going to be much much more expensive than with it). A valid example of that case if when you only care about the last couple of weeks of your data or use it only for alerting, but if it's your case - you also need to ask yourself if you want to introduce Thanos at all instead of vanilla Prometheus?
There's also a case when you might want to disable downsampling at all with `debug.disable-downsampling`. You might want to do it when you know for sure that you are not going to request long ranges of data (obviously, because without downsampling those requests are going to be much much more expensive than with it). A valid example of that case is when you only care about the last couple weeks of your data or use it only for alerting, but if that's your case - you also need to ask yourself if you want to introduce Thanos at all instead of just vanilla Prometheus?

Ideally, you will have equal retention set (or no retention at all) to all resolutions which allow both "zoom in" capabilities as well as performant long ranges queries. Since object storages are usually quite cheap, storage size might not matter that much, unless your goal with thanos is somewhat very specific and you know exactly what you're doing.

Expand Down
33 changes: 24 additions & 9 deletions docs/community.md → docs/contributing/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ type: docs
menu: contributing
---

# General
# Community

Thanos is an open source project and we value and welcome new contributors and members of the community. Here are ways to get in touch with the community:
Thanos is an open source project from the very first commit. We always value and welcome new contributors and members of the community.
Here are ways to get in touch with the community:

## Thanos Community meeting
### Social Media and Announcements

Follow and interact with us on Twitter: [@ThanosMetrics](https://twitter.com/ThanosMetrics)

### Thanos Community Meetings

Thanos Community Meeting is a **public** and **recorded** monthly meeting every second Wednesday 12:00 UTC ([Time zone converter](https://www.thetimezoneconverter.com/?t=12%3A00%20pm&tz=UTC%20(Coordinated%20Universal%20Time)&)).

Expand All @@ -20,20 +25,30 @@ Everyone is welcome to join & add items to the agenda. The meeting happens in Zo
* Agenda: [https://bit.ly/thanos-community-agenda](https://bit.ly/thanos-community-agenda)
* Link to join zoom webinar: [https://zoom.us/j/96476403386](https://zoom.us/j/96476403386)

If you have any suggestions, how we can run the meeting better, please let @povilasv know in CNCF slack.
If you have any suggestions, how we can run the meeting better, please let `@povilasv` or `@metalmatze` know in the CNCF slack.

## Slack
### Slack

* General channel: [#thanos](https://slack.cncf.io/)
* Development related channel: [#thanos-dev](https://slack.cncf.io/)
* Thanos PR discussion & review: [#thanos-prs](https://slack.cncf.io/)
* Development related channel, PR discussions: [#thanos-dev](https://slack.cncf.io/)

### Prometheus Communication Channels

## Prometheus Community & Ecosystem Meeting
Since we are active Prometheus contributors and, some of us, maintainers we are also available on [Prometheus IRC and email-list channels](https://prometheus.io/community/)

The Prometheus & The Ecosystem community meeting is intended to provide a holistic overview of community activities, critical release information, and governance updates for Prometheus & the Ecosystem projects.
### Prometheus Community & Ecosystem Meetings

The Prometheus & The Ecosystem community meeting is intended to provide a holistic overview of community activities, critical release information,
and governance updates for Prometheus & the Ecosystem projects.

Thanos Maintainers regularly join and give announcements and updates.

Meeting details: [https://bit.ly/prometheus-community-agenda](https://bit.ly/prometheus-community-agenda)

### Mentorships

We participate in periodic mentorship programs. Read more [here](https://thanos.io/tip/contributing/mentorship.md/).

### Further Questions

Feel free to contact any of the [Maintainers](https://thanos.io/tip/thanos/maintainers.md/)
61 changes: 61 additions & 0 deletions docs/contributing/mentorship.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: Mentorship
type: docs
menu: contributing
---

# Thanos / Prometheus Open Source Mentorship

Both Thanos and Prometheus projects participate in various, periodic mentoring programs.

[Follow us on Twitter](https://thanos.io/tip/contributing/community.md/#twitter) to be up-to-date with application process and announcements.

Programs we participated / are participating:

* [CommunityBridge](https://github.com/cncf/mentoring/tree/master/communitybridge)
* [Google Summer of Code](https://github.com/cncf/mentoring/tree/master/summerofcode)
* [Red Hat Beyond](https://research.redhat.com/blog/2020/05/24/open-source-development-course-and-devops-methodology/)

## For Mentees

You have been selected for mentorship with Prometheus or Thanos? Congratulations! Here is some short quick information for a quick start!

### Onboarding Check List

* [x] Please see and acknowledge our [Code of Conduct](https://thanos.io/tip/contributing/code_of_conduct.md/). A similar one is for the Prometheus project. TL;DR: Be nice and friendly!
* [x] Create an account on the [CNCF Slack](https://slack.cncf.io/). Please add any profile photo to make it unique. (: This is Thanos's main
chat provider. You can reach any of the mentors there.
* [x] If you are a Prometheus mentee OR if your task will involve collaborating with the Prometheus project, it's also recommended to set up an IRC account e.g by [joining Element](https://prometheus.io/community/). This
the main channel Prometheus Team is using currently.
* [x] Send your mentors your slack account handle, so we can join you to private channels. We have one with just you and your main mentors, and second with all mentees, ex-mentees and mentors.
* [x] Join main [Thanos channels](https://thanos.io/tip/contributing/community.md/#slack) and write a few sentences to about yourself, say hello! 💜
* [x] You are welcome to join Twitter, start following others and gather your own followers! Who knows maybe you will get addicted? (: Feel free to post any
related content around Thanos while mentioning `@ThanosMetrics`.
* [x] Ask maintainers to set up some weekly 2:1 meeting (highly recommended).
* [x] Read our [contributing guides](https://thanos.io/tip/contributing/contributing.md/)
* [x] Read carefully your main GitHub issue and start thinking about it, but don't stress out! It's better to start slowly with a smaller task to get things going. 🚀

### Suggestions

There are certain rules you can follow to make the MOST from your time with us!

* Blocked on the PR, looking for someone to review your contribution, or have some quick question around failed CI? Prefer `public` communication channels.
Both Prometheus and Thanos have a large community that can quickly help you with any issues. There also other mentees who might have had similar questions already! (:
* Say hello to fellow mentees and ex-mentees. We even created a special channel for that goal, so you can team up and build something bigger together: Relation, maybe a future project together or just helping each other out!
Take an example from Summer 2020. Previous Thanos mentees started [Friday fun hangouts](https://twitter.com/bwplotka/status/1270016551664488451) without mentors knowledge and it went pretty awesome! Want to start something similar? Ask fellow ex-mentees for their tips. 🤗
* Think out of the box. Do you feel like something is really painful in project development, functionality or community? Help us improve things and suggest improvements!
* Participate in the Project life cycles. We are active in many conferences e.g. KubeCon, PromCon, FOSDEM, GoDays. We participate in the CNCF SIGs, many side initiatives,
blog posts and videos. Please help us! You are welcome to boost your social media visibility, start blog posting, or even start talking at conferences.
Feel free to ask your mentors for guidance on whatever you are passionate with! We would love to help.
* You are **welcome** or even encouraged to contribute to anything you want during your internship. It's common to wait for a review of your PR some time (it's open source after all!),
so it's not uncommon to drive 2 or 3 things at the time. You don't need to limit contributions to Thanos project as well.
It's totally ok to contribute to some other project we depend on or relate (e.g [Yash](https://twitter.com/yashrsharma44) was heavily contributing to [go-grpc-middleware](https://github.com/grpc-ecosystem/go-grpc-middleware)).
It's also encouraged for Thanos mentee to contribute to Prometheus or Cortex and vice versa. This is because we are part of a bigger **Prometheus Ecosystem Family**.
* Try to be independent and responsible for the feature you want to deliver. The sooner you start to lead your task, the better for you! It's hard in the beginning but try to think about the user experience.
Is it hard or easy to make mistake using it? How difficult is it to migrate to this feature? Is there anything we can do to reduce data loss errors?
* Try to help others by **reviewing** other contributors, mentees or mentors' Pull Requests! It sounds scary, but this is actually the best way to learn about coding practices, patterns and how to maintain high quality codebase! (GIFs on PRs are welcome as well!)

### Thanos Mentoring Office Hours

All current and past mentees are welcome to join our special weekly Mentoring Office Hours. See [this](https://www.bwplotka.dev/2020/thanos-mentoring-office-hours/)) for details.
Ask your mentor to be invited!
16 changes: 9 additions & 7 deletions pkg/query/storeset.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,15 @@ type storeRef struct {
logger log.Logger
}

func (s *storeRef) Update(labelSets []labels.Labels, minTime int64, maxTime int64, storeType component.StoreAPI) {
func (s *storeRef) Update(labelSets []labels.Labels, minTime int64, maxTime int64, storeType component.StoreAPI, rule rulespb.RulesClient) {
s.mtx.Lock()
defer s.mtx.Unlock()

s.storeType = storeType
s.labelSets = labelSets
s.minTime = minTime
s.maxTime = maxTime
s.rule = rule
}

func (s *storeRef) StoreType() component.StoreAPI {
Expand Down Expand Up @@ -436,12 +437,13 @@ func (s *StoreSet) getActiveStores(ctx context.Context, stores map[string]*store
level.Warn(s.logger).Log("msg", "update of store node failed", "err", errors.Wrap(err, "dialing connection"), "address", addr)
return
}
var rule rulespb.RulesClient
if _, ok := ruleAddrSet[addr]; ok {
rule = rulespb.NewRulesClient(conn)
}

st = &storeRef{StoreClient: storepb.NewStoreClient(conn), storeType: component.UnknownStoreAPI, rule: rule, cc: conn, addr: addr, logger: s.logger}
st = &storeRef{StoreClient: storepb.NewStoreClient(conn), storeType: component.UnknownStoreAPI, cc: conn, addr: addr, logger: s.logger}
}

var rule rulespb.RulesClient
if _, ok := ruleAddrSet[addr]; ok {
rule = rulespb.NewRulesClient(st.cc)
}

// Check existing or new store. Is it healthy? What are current metadata?
Expand All @@ -468,7 +470,7 @@ func (s *StoreSet) getActiveStores(ctx context.Context, stores map[string]*store
}

s.updateStoreStatus(st, nil)
st.Update(labelSets, minTime, maxTime, storeType)
st.Update(labelSets, minTime, maxTime, storeType, rule)

mtx.Lock()
defer mtx.Unlock()
Expand Down
Loading

0 comments on commit 7293c9d

Please sign in to comment.