You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
otel: Add multi-standard propagator and fix gcp observability (#240)
* otel: Add gcp propagator
* tests
* go mod
* add debug logging
* Adds span force flushing on close
Ensures all spans are exported before shutdown to prevent data loss, especially in environments like Cloud Run where containers can terminate abruptly.
Introduces a `ForceFlush` method to the `Observer` interface and its implementations, which immediately exports all pending spans.
The `Close` method now calls `ForceFlush` before shutting down the tracer provider.
A default timeout for force flushing is introduced.
* Adds ForceFlush method to Sentry provider
This change adds a `ForceFlush` method to the Sentry provider.
This method allows for explicitly flushing the Sentry client, ensuring
that any pending events are sent to Sentry. This is useful in scenarios
where immediate event delivery is required, such as before application shutdown.
* Adds simple span export option
Allows users to enable immediate span export without batching, providing real-time visibility at the cost of increased network overhead.
This introduces a `use_simple_span` configuration option, enabling spans to be exported immediately when they finish, instead of being batched.
* linting issue
* Improves hostname detection for service identification
Enhances hostname detection by prioritizing GCP metadata service,
falling back to OS hostname, and finally using a default identifier.
This ensures reliable service identification in multi-server and
cloud environments.
Removes unnecessary logging from span start and finish.
* Enhances hostname detection for services
Improves service identification by prioritizing environment variables for hostname detection.
This change replaces reliance on GCP metadata service lookups with a more robust approach using environment variables. It constructs a meaningful hostname based on variables such as service name, revision, and project ID, improving accuracy and avoiding unnecessary external requests. It falls back to system hostname or a default "unknown-host" if no suitable environment variables are found. The hostname initialization is performed only once to cache results.
* Adds span counting feature
Introduces span counting to track and log the number of spans within a trace.
This enables better observability by providing insights into trace complexity and performance.
It introduces a new `SpanCountingProcessor` that wraps the existing span processor.
The feature can be enabled or disabled via configuration.
Adds a YAML parsing test for `SpanCountingConfig`.
Updates hostname logic to avoid duplication when the revision already contains the service name.
* Enables GCP sampler for cloud environments
Configures the observability provider to prioritize local sampling decisions in cloud environments like Cloud Run to prevent trace loss.
Logs additional debug information for configuration values.
* Enables trace propagation configuration
Adds support for configuring trace propagation formats (W3C, B3, Jaeger).
This allows users to specify which propagation formats should be
used when sending and receiving traces. Defaults to W3C if no
formats are specified. This ensures interoperability with
different tracing systems.
Also includes integration tests and examples to verify proper
propagation of trace context with different formats.
* Configures propagation
Configures OpenTelemetry propagation based on user-defined formats or defaults to W3C.
Adds debug logging to track propagation configuration and span counting settings, aiding in troubleshooting and verification.
* Refactors observability configuration and hostname detection
This commit streamlines the observability configuration by removing the span counting feature and simplifying the propagation defaults.
It introduces a centralized hostname detection mechanism to improve service identification across different GCP environments. The previous hostname detection logic was moved to `pkg/zobservability/hostname.go` for reuse and consistency.
The propagation default is now B3 because it's the only one supported by GCP+Signoz.
* Clean up
* clean up
0 commit comments