krakend / krakend-otel

KrakenD component for OpenTelemetry
Apache License 2.0
9 stars 10 forks source link

Support global and per endpoint / backend static attributes in all layers #20

Closed ssepml closed 4 months ago

ssepml commented 5 months ago

Description

This PR adds support for:

Use Case

The main idea is to provide allow for better grouping when creating dashboards with the metrics.

Approach

Two new fields were added to the global and proxy layers

The reason for this option was that the configuration on these two layers was already flat (as opposed to the backend layer which has a metrics and traces section) , hence this keeps the convention already set. Also, changing to something like the backend layer could lead to some breaking changes.

NOTE: I don't have strong opinions on this format and I'm willing to adapt the PR to your preferred way to pass the configuration

Also, configuration provided in an endpoint of backend section will now be parsed to get static labels which will be merged with any other label provided at the top level of the configuration. All other configuration parameters provided will be ignored.

ssepml commented 5 months ago

@dhontecillas thanks for the comments. I reviewed the other PR you created, all looks good to me.

Luckily it maintains you as an author of the commits (I did not want to take credit for your work, just tried to test it in existing code bases)

Don't worry about that :), I don't really mind which PR gets merged and given that your PR addresses all the comments already, feel free to continue with that one.

dhontecillas commented 4 months ago

@ssepml then I will merge the other one directly.

Once again, thank you very much for your contribution.

This PR is merged into: https://github.com/krakend/krakend-otel/pull/27