Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResource ¶
NewResource creates a shared OpenTelemetry resource for all signals (logs, traces, metrics). The resource represents the service identity and should be consistent across all telemetry signals to enable correlation in observability backends.
Types ¶
type Config ¶
type Config struct {
// Endpoint is the OTLP endpoint to send telemetry to
Endpoint string
// Insecure disables TLS for OTLP export (useful for local development)
Insecure bool
// ServiceName is the name of the service
ServiceName string
// ServiceVersion is the version of the service
ServiceVersion string
// GitSHA is the git commit SHA of the build
GitSHA string
// GitDirty indicates if the build had uncommitted changes
GitDirty string
}
Config holds configuration for OpenTelemetry (logs, traces, metrics)
func NewConfig ¶
NewConfig creates OTel configuration from environment variables. gitSHA, dirty, and version should be build information injected via ldflags.
func (*Config) LogsEndpoint ¶
LogsEndpoint returns the endpoint for logs, with signal-specific override support Returns empty string if no endpoint is configured (logs disabled).
func (*Config) MetricsEndpoint ¶
MetricsEndpoint returns the endpoint for metrics, with signal-specific override support Returns empty string if no endpoint is configured (metrics disabled).
func (*Config) TracesEndpoint ¶
TracesEndpoint returns the endpoint for traces, with signal-specific override support Returns empty string if no endpoint is configured (traces disabled).