-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental sdk-trace
module
#325
Closed
Closed
Changes from all commits
Commits
Show all changes
141 commits
Select commit
Hold shift + click to select a range
458dc5f
Draft Trace SDK module
iRevive 6e7e9c0
Enable tests
iRevive 84960aa
Add PassThrough and W3C propagators
iRevive 7bc58f6
Rename `exporters` -> `exporter` package
iRevive affae32
clean up
iRevive 33eb5c2
create headers
iRevive 36a0762
Run `githubWorkflowGenerate`
iRevive 849252f
Add `Hash` and `Show` instances
iRevive 986b117
Add `BatchSpanProcessor`
iRevive 6aeaa1c
Refactor `TracerSuite`
iRevive a4d8ce4
Add `TracerSdkExample`
iRevive 6e06558
Run `scalafix` and `scalafmt`
iRevive 673cf38
Fix compilation issue
iRevive e582c84
Create headers
iRevive 75e2b50
Fix JS compilation issue
iRevive e9f9466
Fix JS compilation issue
iRevive a9381d0
Add samplers
iRevive 3ce9aa5
Run scalafmt and scalafix
iRevive edc107d
Create headers
iRevive e0242f7
Fix doc
iRevive b3a72a8
Relax `Async` constraint, fix unidoc classpath issue
iRevive f718351
Remove duplicated `TextMapPropagator` and `ContextPropagators`
iRevive e327166
Make `SpanContext` sealed, move `vault` dependency to the `java-commo…
iRevive 1ecb8b8
Add tests
iRevive 021686d
run scalafix
iRevive a134642
Remove redundant fields from the `Sampler.shouldSample` interface
iRevive b21482b
Replace `ReadWriteSpan` with `SpanView`
iRevive 3ccca90
Add additional tests
iRevive abaceeb
Fix no-op tracing scope
iRevive 13a17c0
Rework W3CTraceContextPropagator
iRevive 551b215
Merge branch 'upstream-main' into trace-sdk
iRevive fd7d506
Fix compilation issue
iRevive 7f9f0a7
Merge branch 'upstream-main' into trace-sdk
iRevive 87815e0
Merge upstream
iRevive 9d1b80b
Update header
iRevive 91e4cb1
Merge upstream
iRevive 410e13a
Merge branch 'upstream-main' into trace-sdk
iRevive 4e8d392
Merge upstream
iRevive 17265ca
Remove redundant changes
iRevive 02b6830
Merge branch 'upstream-main' into trace-sdk
iRevive 0a448de
Merge upstream
iRevive 682f219
Fix compilation issue
iRevive 437963a
remove `InstrumentationScopeInfo` in favor of `InstrumentationScope`
iRevive 767f45c
Merge branch 'upstream-main' into trace-sdk
iRevive 54e3ef4
Merge branch 'upstream-main' into trace-sdk
iRevive 17164ae
merge upstream
iRevive bf89736
Merge branch 'upstream-main' into trace-sdk
iRevive c17665b
merge upstream
iRevive e8fb815
Merge branch 'upstream-main' into trace-sdk
iRevive 4d37b25
merge upstream
iRevive e2a876d
Merge branch 'upstream-main' into trace-sdk
iRevive 457b4fd
merge upstream
iRevive 80d609d
Rename `SpanView` -> `SpanRef`
iRevive 301abeb
Redefine `SpanRef`
iRevive d14cd97
Merge branch 'upstream-main' into trace-sdk
iRevive f6e1cdd
Merge upstream
iRevive 69f9bc5
Merge branch 'upstream-main' into trace-sdk
iRevive e95828f
merge upstream
iRevive ab21f4b
Merge branch 'upstream-main' into trace-sdk
iRevive 8d22065
Implement `currentSpanOrNoop`
iRevive 13a5362
Merge branch 'upstream-main' into trace-sdk
iRevive ac1eae9
Merge upstream
iRevive 1cbcff8
Generate headers
iRevive 95a4492
move `SdkTracerProviderBuilder` to `SdkTracerProvider.Builder`
iRevive a9b3a63
add docs and tests for `SdkTraceScope`
iRevive e134b6a
add headers
iRevive d70a75d
improve documentation of hte `SdkTraceScope`
iRevive b54f6df
create headers
iRevive 7ca04b3
SpanStorage: use `Ref` instead of `AtomicCell`
iRevive 5d3e3e5
SpanStorage: make it private
iRevive e7b4832
Merge branch 'upstream-main' into trace-sdk
iRevive c3585d0
merge upstream
iRevive 40891c9
fix scaladoc
iRevive b19605a
Merge branch 'upstream-main' into trace-sdk
iRevive a150173
allow propagating spans but not recording them
iRevive 43f9cc8
make `propagating` package-private
iRevive 323514b
Merge branch 'upstream-main' into trace-sdk
iRevive d516195
merge upstream
iRevive 8086d78
Merge branch 'upstream-main' into trace-sdk
iRevive d511a69
merge upstream
iRevive b827b2b
Merge branch 'upstream-main' into trace-sdk
iRevive 8e2a9d7
Merge upstream
iRevive 526f946
fix scaladoc
iRevive 12a859c
remove old `PassThroughPropagator`
iRevive a883f8d
Add `OpenTelemetrySdk` and autoconfigured loader
iRevive 6f8267c
Merge branch 'upstream-main' into trace-sdk
iRevive 0e58bd0
merge upstream
iRevive 9724a39
Merge branch 'upstream-main' into trace-sdk
iRevive 331f8c7
merge upstream
iRevive c2d2b02
fix compilation issue
iRevive d33edec
Merge branch 'upstream-main' into trace-sdk
iRevive dec3c3e
merge upstream
iRevive 4dd1fba
run scalafix & scalafmt
iRevive 5ce21cc
Merge branch 'upstream-main' into trace-sdk
iRevive 8c414c5
Merge branch 'upstream-main' into trace-sdk
iRevive fccaee5
Fix compilation issues
iRevive 0f2b659
rollback non-mandatory scaladoc changes
iRevive 2348a3a
rename `ContextCarrier` -> `LocalProvider`
iRevive 3f2fa65
backport config changes
iRevive 34a5092
backport changes
iRevive 94e7386
Merge branch 'upstream-main' into trace-sdk
iRevive ec7f381
add b3 propagators to the configuration
iRevive 0eb4824
Merge branch 'upstream-main' into trace-sdk
iRevive 2c6adcf
merge upstream
iRevive 220245f
resolve all propagators
iRevive b9ef6c3
add `configKeys` to the error
iRevive efb017c
Merge branch 'upstream-main' into trace-sdk
iRevive 86c3fcf
Merge branch 'upstream-main' into trace-sdk
iRevive 05f79dd
fix compilation issue
iRevive 0ed1662
Merge branch 'upstream-main' into trace-sdk
iRevive b5e1fb3
Add `OtlpSpanExporterAutoConfigure`
iRevive 14e8f24
fix compilation
iRevive cb11667
fix compilation
iRevive 59ab4b9
add 'otlp missing' warning
iRevive 6651392
add `OpenTelemetrySdk.autoConfigured`
iRevive be87a69
Merge branch 'upstream-main' into trace-sdk
iRevive 7b76495
merge upstream
iRevive af028a0
clean up
iRevive 08d2cd6
fix scalajs linker settings
iRevive 072a397
backport changes
iRevive 79cb9be
Merge branch 'upstream-main' into trace-sdk
iRevive bbcba90
Merge branch 'upstream-main' into trace-sdk
iRevive cb30fa0
Merge branch 'upstream-main' into trace-sdk
iRevive cddc710
remove `TracerProviderAutoConfigure`
iRevive 015add6
fix compilation issue
iRevive 9a172db
Merge branch 'upstream-main' into trace-sdk
iRevive 2115fd8
backport changes
iRevive cc3d732
add `SdkTraces`
iRevive d27c4c0
Merge branch 'upstream-main' into trace-sdk
iRevive a0db1da
fix typo
iRevive 70fc5e6
SdkTraces: add scaladocs
iRevive 615e4b9
SdkTraces: add tests
iRevive e09a3c4
Merge branch 'upstream-main' into trace-sdk
iRevive 02ca139
merge upstream
iRevive 073bc27
add `TracerProviderAutoConfigure`
iRevive 75c528c
Merge branch 'upstream-main' into trace-sdk
iRevive 1b4ef0c
Merge branch 'upstream-main' into trace-sdk
iRevive 712afd0
fix tests
iRevive 0e4dd96
add `OpenTelemetrySdkSuite`
iRevive 5816363
Merge branch 'upstream-main' into trace-sdk
iRevive 82c98fa
run scalafmt
iRevive File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2022 Typelevel | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import cats.effect._ | ||
import org.typelevel.otel4s.Attribute | ||
import org.typelevel.otel4s.sdk.OpenTelemetrySdk | ||
import org.typelevel.otel4s.sdk.exporter.otlp.trace.autoconfigure.OtlpSpanExporterAutoConfigure | ||
|
||
object TraceSdkExample extends IOApp.Simple { | ||
|
||
def run: IO[Unit] = | ||
OpenTelemetrySdk | ||
.autoConfigured[IO]( | ||
_.addExporterConfigurer(OtlpSpanExporterAutoConfigure[IO]) | ||
) | ||
.use { autoConfigured => | ||
val sdk = autoConfigured.sdk | ||
|
||
for { | ||
tracer <- sdk.tracerProvider.get("my-tracer") | ||
_ <- tracer | ||
.span("test", Attribute("test", "test123")) | ||
.use(sd => IO.println(sd.context)) | ||
} yield () | ||
} | ||
|
||
} |
This file contains 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
44 changes: 44 additions & 0 deletions
44
sdk/common/src/main/scala/org/typelevel/otel4s/sdk/internal/ComponentRegistry.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2023 Typelevel | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.typelevel.otel4s | ||
package sdk | ||
package internal | ||
|
||
import org.typelevel.otel4s.sdk.common.InstrumentationScope | ||
|
||
// todo: implement caching | ||
final class ComponentRegistry[F[_], A]( | ||
factory: InstrumentationScope => F[A] | ||
) { | ||
|
||
def get( | ||
name: String, | ||
version: Option[String], | ||
schemaUrl: Option[String], | ||
attributes: Attributes | ||
): F[A] = { | ||
buildComponent( | ||
InstrumentationScope(name, version, schemaUrl, attributes) | ||
) | ||
} | ||
|
||
private def buildComponent(info: InstrumentationScope): F[A] = { | ||
val component = factory(info) | ||
component | ||
} | ||
|
||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A fully functional example