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

Add Implementation to provide OTEL Resource Attributes #12175

Merged
merged 5 commits into from
Oct 31, 2023

Conversation

senthuran16
Copy link
Member

Purpose

$Subject. Fixes wso2/api-manager#2123

Approach

OTEL Resource attributes can be provided:

  • Via deployment.toml
    [[apim.open_telemetry.resource_attributes]]
    name = "service.name"
    value = "MyService"
    
    [[apim.open_telemetry.resource_attributes]]
    name = "deployment.environment"
    value = "Production"
    

AND

  • Via the OTEL_RESOURCE_ATTRIBUTES environment variable (as per the OpenTelemetry spec [1])
    export OTEL_RESOURCE_ATTRIBUTES=deployment.environment=Production,service.name=MyService
    

When a resource attribute is given via both the deployment.toml and the OTEL_RESOURCE_ATTRIBUTES env variable, the value of the attribute given via the env variable will replace the value given via deployment.toml.

Related PRs

Reading the Config - j2 file change: TODO

[1] https://github.com/open-telemetry/opentelemetry-specification/blob/8946dfc6a2302f78b0224fcc3f4dfb816a7bb1f4/specification/resource/sdk.md#specifying-resource-information-via-an-environment-variable

@dushaniw
Copy link
Contributor

dushaniw commented Oct 31, 2023

Failing test suit has no impact from the PR changes. Hence merging. Need to separately look into the port issue in the PR build.

@dushaniw dushaniw merged commit d644af0 into wso2:master Oct 31, 2023
3 of 6 checks passed
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.

Support OTEL_RESOURCE_ATTRIBUTES as configuration for Open Telemetry connection
2 participants