Skip to content

Commit

Permalink
Merge branch 'main' into igorpeshansky-windows-logger-timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpeshansky authored Aug 9, 2024
2 parents 771e8ab + 7638bb2 commit e130a3c
Show file tree
Hide file tree
Showing 21 changed files with 5,989 additions and 23 deletions.
25 changes: 25 additions & 0 deletions .chloggen/codeboten_mdatagen-expose-scope-name.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: mdatagen

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: export ScopeName in internal/metadata package

# One or more tracking issues or pull requests related to the change
issues: [10845]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: This can be used by components that need to set their scope name manually. Will save component owners from having to store a variable, which may diverge from the scope name used by the component for emitting its own telemetry.

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
4 changes: 4 additions & 0 deletions .chloggen/semconv-v1.27.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
change_type: enhancement
component: semconv
note: Add semantic conventions version v1.27.0
issues: [10837]
6 changes: 6 additions & 0 deletions .github/workflows/build-and-test-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
~\go\pkg\mod
~\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Ensure required ports in the dynamic range are available
run: |
& ${{ github.workspace }}\.github\workflows\scripts\win-required-ports.ps1
- name: Run Unit Tests
run: make gotest

Expand All @@ -55,6 +58,9 @@ jobs:
~\go\pkg\mod
~\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Ensure required ports in the dynamic range are available
run: |
& ${{ github.workspace }}\.github\workflows\scripts\win-required-ports.ps1
- name: Make otelcorecol
run: make otelcorecol
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate-semantic-conventions-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
run: |
message="Add semantic conventions version $VERSION"
body="Add semantic conventions version \`$VERSION\`."
body="Add semantic conventions version \`$VERSION\`. Related to #10842"
branch="opentelemetrybot/add-semantic-conventions-${VERSION}"
git checkout -b $branch
Expand All @@ -96,7 +96,7 @@ jobs:
change_type: enhancement
component: semconv
note: Add semantic conventions version $VERSION
issues: [ $pull_request_number ]
issues: [10842]
EOF
git add .chloggen/semconv-$VERSION.yaml
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/scripts/win-required-ports.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<#
.SYNOPSIS
This script ensures that the ports required by the default configuration of the collector are available.
.DESCRIPTION
Certain runs on GitHub Actions sometimes have ports required by the default configuration reserved by other
applications via the WinNAT service.
#>

#Requires -RunAsAdministrator

netsh interface ip show excludedportrange protocol=tcp

Stop-Service winnat

# Only port in the dynamic range that is being, from time to time, reserved by other applications.
netsh interface ip add excludedportrange protocol=tcp startport=55679 numberofports=1

Start-Service winnat

netsh interface ip show excludedportrange protocol=tcp
2 changes: 1 addition & 1 deletion cmd/builder/internal/builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func Generate(cfg Config) error {
}
// create a warning message for non-aligned builder and collector base
if cfg.Distribution.OtelColVersion != defaultOtelColVersion {
cfg.Logger.Info("You're building a distribution with non-aligned version of the builder. Compilation may fail due to API changes. Please upgrade your builder or API", zap.String("builder-version", defaultOtelColVersion))
cfg.Logger.Info("You're building a distribution with non-aligned version of the builder. The version mismatch may cause a compilation failure. It's recommended to use the same version.", zap.String("collector-version", cfg.Distribution.OtelColVersion), zap.String("builder-version", defaultOtelColVersion))
}
// if the file does not exist, try to create it
if _, err := os.Stat(cfg.Distribution.OutputPath); os.IsNotExist(err) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions cmd/mdatagen/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,12 +546,14 @@ import (
"go.opentelemetry.io/collector/config/configtelemetry"
)
const ScopeName = ""
func Meter(settings component.TelemetrySettings) metric.Meter {
return settings.MeterProvider.Meter("")
return settings.MeterProvider.Meter(ScopeName)
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
return settings.TracerProvider.Tracer("")
return settings.TracerProvider.Tracer(ScopeName)
}
`,
},
Expand Down Expand Up @@ -580,12 +582,14 @@ import (
"go.opentelemetry.io/collector/config/configtelemetry"
)
const ScopeName = ""
func Meter(settings component.TelemetrySettings) metric.Meter {
return settings.MeterProvider.Meter("")
return settings.MeterProvider.Meter(ScopeName)
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
return settings.TracerProvider.Tracer("")
return settings.TracerProvider.Tracer(ScopeName)
}
`,
},
Expand Down
6 changes: 4 additions & 2 deletions cmd/mdatagen/templates/telemetry.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ import (
"go.opentelemetry.io/collector/config/configtelemetry"
)

const ScopeName = "{{ .ScopeName }}"

func Meter(settings component.TelemetrySettings) metric.Meter {
return settings.MeterProvider.Meter("{{ .ScopeName }}")
return settings.MeterProvider.Meter(ScopeName)
}

func Tracer(settings component.TelemetrySettings) trace.Tracer {
return settings.TracerProvider.Tracer("{{ .ScopeName }}")
return settings.TracerProvider.Tracer(ScopeName)
}
{{- if .Telemetry.Metrics }}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions semconv/v1.27.0/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

// Package semconv implements OpenTelemetry semantic conventions.
//
// OpenTelemetry semantic conventions are agreed standardized naming
// patterns for OpenTelemetry things. This package represents the v1.27.0
// version of the OpenTelemetry semantic conventions.
package semconv // import "go.opentelemetry.io/collector/semconv/v1.27.0"
Loading

0 comments on commit e130a3c

Please sign in to comment.