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

Httpd add possibility to configure custom attributes and resources #14

Merged

Conversation

TomRoSystems
Copy link
Member

No description provided.

- added possibility to configure custom attributes
- added possibility to configure resources (once otel-cpp supports it for spans)
@@ -32,4 +32,7 @@ OpenTelemetryPath /tmp/output-spans

# OpenTelemetryIgnoreInbound off

# OpenTelemetrySetResource service.name apache-web-server
# OpenTelemetrySetAttribute foo bar
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these attributes global, for all routes? Is it possible to set attributes for specific route?

With nginx it's possible to set these per server, route basis.

Copy link
Member Author

Choose a reason for hiding this comment

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

At the moment those are global settings.

@@ -85,8 +85,17 @@ void initTracer()
processor = std::make_shared<sdktrace::SimpleSpanProcessor>(std::move(exporter));
}

opentelemetry::sdk::resource::ResourceAttributes resAttrs({{"service.name", "httpd"}});
Copy link
Contributor

Choose a reason for hiding this comment

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

From the spec:

[1]: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to u nknown_service: concatenated with process.executable.name, e.g. unknown_service:bash. If process.executable.name is not available, the value MUST be set to unknown_service.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Thanks. Removed.

@@ -85,8 +85,17 @@ void initTracer()
processor = std::make_shared<sdktrace::SimpleSpanProcessor>(std::move(exporter));
}

opentelemetry::sdk::resource::ResourceAttributes resAttrs({{"service.name", "httpd"}});
// add custom-configured resources
for(auto &it:config.resources)
Copy link
Contributor

Choose a reason for hiding this comment

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

Spacing?

@@ -54,6 +55,8 @@ struct OtelConfig
// context propagation
bool ignore_inbound;
OtelPropagation propagation;
std::unordered_map<std::string, std::string> attribiutes;
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo here

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed typo.

@lalitb lalitb merged commit 46c406e into open-telemetry:main Apr 7, 2021
@marcalff marcalff added the instrumentation:httpd httpd module label May 15, 2024
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.

4 participants