Skip to content

Commit

Permalink
Merge branch 'main' into hanyuancheung-emeritus
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared authored Oct 4, 2024
2 parents 3357640 + 1c6d9f9 commit db1f270
Show file tree
Hide file tree
Showing 26 changed files with 1,170 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
cp coverage.txt $TEST_RESULTS
cp coverage.html $TEST_RESULTS
- name: Upload coverage report
uses: codecov/codecov-action@v4.5.0
uses: codecov/codecov-action@v4.6.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/links-fail-fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,22 @@ on:
jobs:
check-links:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

- name: Link Checker
uses: lycheeverse/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail: true
args: --max-concurrency 5 --cache --max-cache-age 1d .
14 changes: 14 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,27 @@ on:
jobs:
check-links:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v4


- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

- name: Link Checker
id: lychee
uses: lycheeverse/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: --max-concurrency 1 --cache --max-cache-age 1d .

- name: Create Issue From File
if: steps.lychee.outputs.exit_code != 0
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- The `Severitier` and `SeverityVar` types are added to `go.opentelemetry.io/contrib/processors/minsev` allowing dynamic configuration of the severity used by the `LogProcessor`. (#6116)
- Move examples from `go.opentelemetry.io/otel` to this repository under `examples` directory. (#6158)
- Support yaml/json struct tags for generated code in `go.opentelemetry.io/contrib/config`. (#5433)
- Add support for parsing YAML configuration via `ParseYAML` in `go.opentelemetry.io/contrib/config`. (#5433)

### Changed

Expand Down
4 changes: 2 additions & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/ @open-te
instrumentation/google.golang.org/grpc/otelgrpc/ @open-telemetry/go-approvers @dashpole
instrumentation/gopkg.in/macaron.v1/otelmacaron/ @open-telemetry/go-approvers

instrumentation/host/ @open-telemetry/go-approvers
instrumentation/host/ @open-telemetry/go-approvers @dmathieu
instrumentation/net/http/httptrace/otelhttptrace/ @open-telemetry/go-approvers @dmathieu
instrumentation/net/http/otelhttp/ @open-telemetry/go-approvers @dmathieu
instrumentation/runtime/ @open-telemetry/go-approvers
instrumentation/runtime/ @open-telemetry/go-approvers @dmathieu

processors/baggagecopy @open-telemetry/go-approvers @codeboten @MikeGoldsmith
processors/minsev @open-telemetry/go-approvers @MrAlias
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ genjsonschema: genjsonschema-cleanup $(GOJSONSCHEMA)
--capitalization OTLP \
--struct-name-from-title \
--package config \
--tags mapstructure \
--output ${GENERATED_CONFIG} \
${OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_SRC_DIR}/schema/opentelemetry_configuration.json
@echo Modify jsonschema generated files.
Expand Down
17 changes: 12 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"context"
"errors"

"gopkg.in/yaml.v3"

"go.opentelemetry.io/otel/log"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/trace"
Expand Down Expand Up @@ -61,8 +63,6 @@ func (s *SDK) Shutdown(ctx context.Context) error {
}

// NewSDK creates SDK providers based on the configuration model.
//
// Caution: The implementation only returns noop providers.
func NewSDK(opts ...ConfigurationOption) (SDK, error) {
o := configOptions{}
for _, opt := range opts {
Expand Down Expand Up @@ -127,6 +127,13 @@ func WithOpenTelemetryConfiguration(cfg OpenTelemetryConfiguration) Configuratio
})
}

// TODO: implement parsing functionality:
// - https://github.com/open-telemetry/opentelemetry-go-contrib/issues/4373
// - https://github.com/open-telemetry/opentelemetry-go-contrib/issues/4412
// ParseYAML parses a YAML configuration file into an OpenTelemetryConfiguration.
func ParseYAML(file []byte) (*OpenTelemetryConfiguration, error) {
var cfg OpenTelemetryConfiguration
err := yaml.Unmarshal(file, &cfg)
if err != nil {
return nil, err
}

return &cfg, nil
}
Loading

0 comments on commit db1f270

Please sign in to comment.