Add initial version of otelcfg#13
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds an initial version of the otelcfg module to configure OpenTelemetry for Cloud Run services and jobs, along with updating dependency management.
- Introduces tracer provider setup and Cloud Trace OTLP exporter in otelcfg/trace.go.
- Adds resource creation functions for Cloud Run services and jobs in otelcfg/resources.go.
- Implements a generic option interface to simplify configuration in otelcfg/option.go.
- Updates Dependabot configuration to include the new otelcfg directory.
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| otelcfg/trace.go | Adds tracer provider configuration and Cloud Trace OTLP exporter functionality. |
| otelcfg/resources.go | Provides functions to generate OpenTelemetry resources for Cloud Run services and jobs. |
| otelcfg/option.go | Defines a generic option interface and helper to apply configuration options. |
| .github/dependabot.yaml | Updates dependency management to monitor changes in the new otelcfg module. |
Files not reviewed (1)
- otelcfg/go.mod: Language not supported
Comments suppressed due to low confidence (1)
otelcfg/trace.go:65
- The usage of slices.Backward is unclear since it is not part of the standard Go slices package; ensure this function is defined or consider replacing it with a manual reverse iteration over shutdownFuncs.
for _, fn := range slices.Backward(shutdownFuncs) {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new
otelcfgmodule for OpenTelemetry configuration and updates the Dependabot configuration to include this module. The changes focus on adding OpenTelemetry resources, tracer provider setup, and configuration options for Cloud Run services and jobs.New
otelcfgModule.github/dependabot.yamlto include theotelcfgdirectory for dependency updates.otelcfg/go.mod: Added a newgo.modfile for theotelcfgmodule, specifying dependencies for OpenTelemetry and related libraries.OpenTelemetry Resource Management
otelcfg/resources.go: Added functionsNewServiceResourceandNewJobResourceto create OpenTelemetry resources for Cloud Run services and jobs, using semantic conventions for attributes.Tracer Provider Configuration
otelcfg/trace.go: IntroducedSetupTracerProviderfor setting up a tracer provider with options like custom propagators and span exporters. AddedCloudTraceOLTPExporterfor exporting spans to Google Cloud Trace.General Utility
otelcfg/option.go: Added a genericoptioninterface andoptionFunctype to simplify configuration handling.