Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move promtail StreamLagLabels config to upper level config.Config #5686

Merged
merged 5 commits into from
Mar 23, 2022

Conversation

ssncferreira
Copy link
Contributor

What this PR does / why we need it:

On the refactor PR #5521 configuration StreamLagLabels was moved to a new wrapper config, meaning the promtail client configuration now has an additional configs parameter:

clients:                                                                                                              
   configs:                                                                                                                                                                     
     - external_labels:                                                                                                                                                         
         cluster: dev-eu-west-0                                                                                                                                                 
       url: http://145265:${LOCAL_COLLECTION_WRITER_KEY}@cortex-gw.loki-dev-008.svc.cluster.local/loki/api/v1/push

This is a breaking change as clients with the previous configuration will fail.
Therefore, the solution proposed in this PR is to keep the property stream_lag_labels in the client.Config as deprecated (and unused) for backward compatibility and move this property to the upper config.Config structure. The new structure is as follows:

clients:                                                                                                              
  - external_labels:                                                                                                                                                         
     cluster: dev-eu-west-0                                                                                                                                                 
  url: http://145265:${LOCAL_COLLECTION_WRITER_KEY}@cortex-gw.loki-dev-008.svc.cluster.local/loki/api/v1/push
stream_lag_labels:
  ...

Which issue(s) this PR fixes:

Special notes for your reviewer:

Checklist

  • Documentation added
  • Tests updated
  • Add an entry in the CHANGELOG.md about the changes.

@ssncferreira ssncferreira requested a review from a team as a code owner March 21, 2022 15:26
@cstyan
Copy link
Contributor

cstyan commented Mar 21, 2022

I think I agree with @dannykopping's comment from slack, it feels like this would be good to nest under a new options or metrics_options named config section if we're not going to keep it under clients.

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
@dannykopping dannykopping merged commit 1d14618 into main Mar 23, 2022
@dannykopping dannykopping deleted the promtail_stream_lag_labels_config branch March 23, 2022 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants