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

Remove label logic from client #210

Merged
merged 1 commit into from
Dec 30, 2023
Merged

Remove label logic from client #210

merged 1 commit into from
Dec 30, 2023

Conversation

kuskoman
Copy link
Owner

The PR removes code related to #202
Basically, since all instances now have hostname attached, a simple proxy should be able to solve the issue
I took some time to implement custom labeling, but it required way more logic than it gives benefits:

  • config had to have custom logic for:
    a. verifying label consistency
    b. sorting label keys
    c. sorting label values according to keys order
  • client had to preserve either reference to config or reference to sorted slice of keys that are later on used to determine values to add to each and every metric
  • since Allow to specify multiple logstash instances #79 was closed, there is no simple way that i know to treat these labels as const labels. therefore the logic is mixed with existing variableLabels logic which makes code way more unreadable than it currently is

I believe there are existing solutions allowing to relabel prometheus metrics.
In most cases hostname label alone should be sufficient, but if you are running multiple instances monitoring for example a local url you may consider using combination of both exporter and logstash address as a base for relabeling

Copy link

codecov bot commented Dec 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b35f92e) 100.00% compared to head (9ba1225) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #210   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          769       763    -6     
=========================================
- Hits           769       763    -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kuskoman
Copy link
Owner Author

@dvhh this is how this currently looks in grafana
image

@kuskoman kuskoman merged commit e4e5d18 into master Dec 30, 2023
16 checks passed
@kuskoman kuskoman deleted the remove-custom-labels branch December 30, 2023 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant