1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00
Commit Graph

9 Commits

Author SHA1 Message Date
Matthieu MOREL 1bae8f7347 chore: enable extra-rules from gofumpt (#7114)
#### Description

Enable extra rules from
[gofumpt](https://golangci-lint.run/usage/formatters/#gofumpt) that also
fixes paramTypeCombine from go-critic

Also defines `go.opentelemetry.io/otel` as in
https://github.com/open-telemetry/opentelemetry-go-contrib/pull/7637

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2025-08-03 08:24:33 -07:00
Matthieu MOREL 982391315f chore: enable gocritic linter (#7095)
#### Description

Enable and fixes several rules from
[gocritic](https://golangci-lint.run/usage/linters/#gocritic) linter

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2025-07-29 09:20:32 -07:00
Peter Bryant 9f282a1e1d Fix/issue 6560 install trace bridge test (#6814)
Fixes #6560

## Summary

Adds tests for the `InstallTraceBridge` function to verify that the
`octrace.DefaultTracer` is correctly set when the function is called
with various configuration options.

## Changes

- Added `TestInstallTraceBridge` test function in
`bridge/opencensus/trace_test.go`
- Tests cover multiple scenarios:
  - Installation with default options
  - Installation with custom tracer provider
  - Installation with tracer provider and exporter
- Verifies that `octrace.DefaultTracer` is properly updated.
- Verifies that the installed tracer can create functional spans.
- Ensures proper cleanup of global state after tests.

## Test Results

```bash
=== RUN   TestInstallTraceBridge
=== RUN   TestInstallTraceBridge/install_with_default_options
=== RUN   TestInstallTraceBridge/install_with_custom_tracer_provider
=== RUN   TestInstallTraceBridge/install_with_tracer_provider_with_exporter
--- PASS: TestInstallTraceBridge (0.00s)
```

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: dmathieu <damien.mathieu@elastic.co>
2025-05-26 09:33:04 +02:00
Peter Bryant 607db85570 bridge/opencensus: add test for OTelSpanContextToOC function (#6813)
## Description
   
Adds tests for the `OTelSpanContextToOC` func in the `opencensus bridge`
as requested in issue #6561.
   
   ## Changes
   
   - Added `TestOTelSpanContextToOC` function with four test cases:
     - Empty span context conversion
     - Sampled span context conversion  
     - Not sampled span context conversion
     - Span context with tracestate conversion
   
   ## Testing
   
   The test verifies that the following fields are correctly converted:
   - TraceID 
   - SpanID
   - TraceOptions (sampled/not sampled)
   - Tracestate (when present)
   
   All existing tests continue to pass.
   
   ## Fixes
   
   Closes #6561

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2025-05-23 14:35:53 -07:00
Tetsuya KIKUCHI 0ed4af71a0 opencensus: add TestOCSpanContextToOTel (#6600)
Fixes #6562

I ignored `tracestate` for the following note in the Issue.

> The full depth of conversion for each field is out of scope. That is
left for unit-tests of the oc2otel package.

---------

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>
2025-04-07 12:28:42 +02:00
Matthieu MOREL 6edc7a63df [chore]: enable expected-actual rule from testifylint (#5848)
Testifylint is a linter that provides best practices with the use of
testify.

This PR enables
[expected-actual](https://github.com/Antonboom/testifylint?tab=readme-ov-file#expected-actual)
rule from [testifylint](https://github.com/Antonboom/testifylint)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-26 12:04:33 +02:00
Damien Mathieu 3e17ef99d6 Allow relying on InstrumentationScope in SpanStub and fix remaining deprecation issues (#5627)
Rather than the deprecated InstrumentationLibrary

This is a replacement for
https://github.com/open-telemetry/opentelemetry-go/pull/3104, as after
this, there is no usage of `instrumentation.Library` within the SDK
anymore.

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Sam Xie <sam@samxie.me>
2024-07-24 09:33:07 +02:00
Robert Pająk 7dea232a46 [chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
David Ashpole 1074d64d04 Add scope version to opencensus trace and metric bridges (#4584) 2023-10-11 08:48:58 +02:00