Skip to content

Add initial version of otelcfg#13

Merged
joaopenteado merged 1 commit into
mainfrom
otelcfg
May 5, 2025
Merged

Add initial version of otelcfg#13
joaopenteado merged 1 commit into
mainfrom
otelcfg

Conversation

@joaopenteado

Copy link
Copy Markdown
Owner

This pull request introduces a new otelcfg module 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 otelcfg Module

  • Dependabot configuration: Updated .github/dependabot.yaml to include the otelcfg directory for dependency updates.
  • otelcfg/go.mod: Added a new go.mod file for the otelcfg module, specifying dependencies for OpenTelemetry and related libraries.

OpenTelemetry Resource Management

  • otelcfg/resources.go: Added functions NewServiceResource and NewJobResource to create OpenTelemetry resources for Cloud Run services and jobs, using semantic conventions for attributes.

Tracer Provider Configuration

  • otelcfg/trace.go: Introduced SetupTracerProvider for setting up a tracer provider with options like custom propagators and span exporters. Added CloudTraceOLTPExporter for exporting spans to Google Cloud Trace.

General Utility

  • otelcfg/option.go: Added a generic option interface and optionFunc type to simplify configuration handling.

@joaopenteado joaopenteado requested a review from Copilot May 5, 2025 07:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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) {

@joaopenteado joaopenteado merged commit 1c3a5d5 into main May 5, 2025
@joaopenteado joaopenteado deleted the otelcfg branch May 5, 2025 07:09
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.

2 participants