Skip to content

Commit

Permalink
Merge branch 'main' into fix/OTEL-3607
Browse files Browse the repository at this point in the history
  • Loading branch information
ekquasar authored Nov 30, 2023
2 parents 7bddd45 + d95c457 commit b0bb7f8
Show file tree
Hide file tree
Showing 16 changed files with 522 additions and 61 deletions.
11 changes: 6 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
* @open-telemetry/docs-approvers

# content owners
content-modules/opamp-spec @open-telemetry/docs-approvers @open-telemetry/opamp-spec-approvers
content-modules/opentelemetry-proto @open-telemetry/docs-approvers @open-telemetry/specs-approvers
content-modules/opentelemetry-specification @open-telemetry/docs-approvers @open-telemetry/specs-approvers
content-modules/semantic-conventions @open-telemetry/docs-approvers @open-telemetry/specs-semconv-approvers
content/en/blog/ @open-telemetry/docs-approvers @open-telemetry/blog-approvers
content-modules/ @open-telemetry/docs-maintainers
content-modules/opamp-spec @open-telemetry/docs-maintainers @open-telemetry/opamp-spec-approvers
content-modules/opentelemetry-proto @open-telemetry/docs-maintainers @open-telemetry/specs-approvers
content-modules/opentelemetry-specification @open-telemetry/docs-maintainers @open-telemetry/specs-approvers
content-modules/semantic-conventions @open-telemetry/docs-maintainers @open-telemetry/specs-semconv-approvers
content/en/blog/ @open-telemetry/docs-maintainers
content/en/community/end-user/ @open-telemetry/docs-approvers @open-telemetry/end-user-wg
content/en/docs/collector @open-telemetry/docs-approvers @open-telemetry/collector-approvers
content/en/docs/demo @open-telemetry/docs-approvers @open-telemetry/demo-approvers
Expand Down
39 changes: 25 additions & 14 deletions .github/workflows/pr-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@ jobs:
contains(github.event.comment.body, '/fix:format')
permissions:
contents: write
pull-requests: write

steps:
- name: Context info
run: |
echo $PR_NUM
echo $COMMENT
- uses: actions/checkout@v4

- name: Write start comment
run: |
gh pr comment $PR_NUM -b "You triggered fix:format action run at $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
- uses: actions/checkout@v4
env:
GH_TOKEN: ${{ github.token }}

- run: gh pr checkout $PR_NUM -b "pr-action-${RANDOM}"
env:
Expand Down Expand Up @@ -63,12 +66,12 @@ jobs:
echo current_branch=$current_branch
# gh pr checkout sets some git configs that we can use to make sure
# we push to the right repo & to the right branch
push_remote=$(git config --get branch.${current_branch}.pushremote)
echo push_remote=$push_remote
push_remote_branch=$(git config --get branch.${current_branch}.merge)
echo push_remote_branch=$push_remote_branch
remote_repo=$(git config --get branch.${current_branch}.remote)
echo remote_repo=$remote_repo
remote_branch=$(git config --get branch.${current_branch}.merge)
echo remote_branch=$remote_branch
git commit -m 'Results from /fix:format'
git push ${push_remote} HEAD:${push_remote_branch}
git push ${remote_repo} HEAD:${remote_branch}
else
echo "No changes to commit"
fi
Expand All @@ -79,6 +82,8 @@ jobs:
if: ${{ failure() || cancelled() }}
run: |
gh pr comment $PR_NUM -b "fix:format run failed, please check $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID for details"
env:
GH_TOKEN: ${{ github.token }}

fix-refcache:
name: /fix:refcache
Expand All @@ -89,6 +94,7 @@ jobs:
contains(github.event.comment.body, '/fix:refcache')
permissions:
contents: write
pull-requests: write

env:
DEPTH: --depth 100 # submodule clone depth
Expand All @@ -99,11 +105,14 @@ jobs:
echo $PR_NUM
echo $COMMENT
- uses: actions/checkout@v4

- name: Write start comment
run: |
gh pr comment $PR_NUM -b "You triggered fix:refcache action run at $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
env:
GH_TOKEN: ${{ github.token }}

- uses: actions/checkout@v4
# By providing a branch name the checkout will not break if a branch with the
# same name exists already upstream (e.g. patch-X)
- run: gh pr checkout $PR_NUM -b "pr-action-${RANDOM}"
Expand Down Expand Up @@ -137,12 +146,12 @@ jobs:
echo current_branch=$current_branch
# gh pr checkout sets some git configs that we can use to make sure
# we push to the right repo & to the right branch
push_remote=$(git config --get branch.${current_branch}.pushremote)
echo push_remote=$push_remote
push_remote_branch=$(git config --get branch.${current_branch}.merge)
echo push_remote_branch=$push_remote_branch
git commit -m 'Results from /fix:recache'
git push ${push_remote} HEAD:${push_remote_branch}
remote_repo=$(git config --get branch.${current_branch}.remote)
echo remote_repo=$remote_repo
remote_branch=$(git config --get branch.${current_branch}.merge)
echo remote_branch=$remote_branch
git commit -m 'Results from /fix:refcache'
git push ${remote_repo} HEAD:${remote_branch}
else
echo "No changes to commit"
fi
Expand All @@ -153,3 +162,5 @@ jobs:
if: ${{ failure() || cancelled() }}
run: |
gh pr comment $PR_NUM -b "fix:recache run failed, please check $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID for details"
env:
GH_TOKEN: ${{ github.token }}
18 changes: 8 additions & 10 deletions .htmltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ IgnoreDirectoryMissingTrailingSlash: true
IgnoreAltMissing: true
IgnoreCanonicalBrokenLinks: false
CheckMailto: false
TestFilesConcurrently: true
IgnoreDirs:
- ^blog/(\d+/)?page/\d+
IgnoreInternalURLs: # list of paths
IgnoreURLs: # list of regexs of paths or URLs to be ignored
- ^/docs/instrumentation/\w+/(api|examples)/$
Expand All @@ -18,6 +21,9 @@ IgnoreURLs: # list of regexs of paths or URLs to be ignored
- ^https?://127\.0\.0\.1\b
- ^https?://(otel-demo|traefik)\.localhost

# OpAMP spec:
- ^https://pdf.sciencedirectassets.com/280203/1-s2.0-S1877050919X0006X/1-s2.0-S1877050919303576/main.pdf\?

# Sites that deny access, always yielding 403 Forbidden (unless mentioned otherwise)
- ^https://(www\.)?linkedin\.com\b # 999 Request Denied
- ^https://(www\.)?mvnrepository\.com
Expand All @@ -41,13 +47,5 @@ IgnoreURLs: # list of regexs of paths or URLs to be ignored
- ^https://crates\.io/crates
# TODO: drop after fix to https://github.com/micrometer-metrics/micrometer-docs/issues/239
- ^https://micrometer\.io/docs
# TODO: drop after fix to https://github.com/google/docsy/issues/1337
- ^https://opentelemetry\.io/.
# TODO: drop after fix to https://github.com/open-telemetry/opentelemetry.io/issues/2354
- ^https://open-telemetry\.github\.io/opentelemetry-python/benchmarks/
# TODO: remove after merge of https://github.com/open-telemetry/opentelemetry.io/pull/2594
- ^https://elastic.co/blog/ecs-elastic-common-schema-otel-opentelemetry-announcement
# TODO: remove after OpAMP spec is fixed: https://github.com/open-telemetry/opamp-spec/issues/148
- ^https://example.com:4318/v1/metrics
- ^https://pdf.sciencedirectassets.com/280203/1-s2.0-S1877050919X0006X
- ^https://research.fb.com/wp-content/uploads/2016/11/holistic-configuration-management-at-facebook.pdf
# TODO: ensure .json isn't set as an alternate in ecosystem/registry/index.html and then drop:
- ^https://opentelemetry.io/ecosystem/registry/index.json
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,29 @@ schedule.
Meeting notes are available as a public [Google doc][]. If you have trouble
accessing the doc, please get in touch on [Slack][].

Roles:
Here is a list of community roles with current and previous members:

- Approvers: [@open-telemetry/docs-approvers][]

- [Fabrizio Ferri-Benedetti](https://github.com/theletterf), Splunk
- [Michael Hausenblas](https://github.com/mhausenblas), Amazon

- Maintainers: [@open-telemetry/docs-maintainers][]
- Blog approvers: [@open-telemetry/blog-approvers][]

- [Austin Parker](https://github.com/austinlparker), Honeycomb
- [Patrice Chalin](https://github.com/chalin), CNCF
- [Phillip Carter](https://github.com/cartermp), Honeycomb
- [Severin Neumann](https://github.com/svrnm), Cisco

- Emeritus approvers:

- [Paul Bruce](https://github.com/paulsbruce)

- Emeritus maintainers:

- [Steve Flanders](https://github.com/flands)
- [Morgan McLean](https://github.com/mtwo)
- [jparsana](https://github.com/jparsana)

Learn more about roles in the [community repository][]. Thanks to [all who have
already contributed][contributors]!
Expand All @@ -91,8 +109,6 @@ already contributed][contributors]!
[adding to the registry]: https://opentelemetry.io/ecosystem/registry/adding/
[let us know]:
https://github.com/open-telemetry/opentelemetry.io/issues/new/choose
[@open-telemetry/blog-approvers]:
https://github.com/orgs/open-telemetry/teams/blog-approvers
[@open-telemetry/docs-approvers]:
https://github.com/orgs/open-telemetry/teams/docs-approvers
[@open-telemetry/docs-maintainers]:
Expand Down
2 changes: 1 addition & 1 deletion content-modules/opamp-spec
2 changes: 1 addition & 1 deletion content/en/docs/collector/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Collector
description: Vendor-agnostic way to receive, process and export telemetry data.
aliases: [collector/about]
cascade:
vers: 0.89.0
vers: 0.90.0
weight: 10
---

Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/collector/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ To follow this tutorial you need the following
telemetrygen traces --otlp-insecure --duration 5s
```

After five seconds, `telemetrygen` stops and shows the sended messages in the
After five seconds, `telemetrygen` stops and shows the sent messages in the
console:

```text
Expand Down
1 change: 1 addition & 0 deletions content/en/docs/demo/services/cart.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Action<ResourceBuilder> appResourceBuilder =
builder.Services.AddOpenTelemetry()
.ConfigureResource(appResourceBuilder)
.WithMetrics(meterBuilder => meterBuilder
.AddProcessInstrumentation()
.AddRuntimeInstrumentation()
.AddAspNetCoreInstrumentation()
.AddOtlpExporter());
Expand Down
122 changes: 118 additions & 4 deletions content/en/docs/instrumentation/java/automatic/spring-boot.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Spring Boot
linkTitle: Spring Boot
weight: 30
description: Spring instrumentation for OpenTelemetry Java
cSpell:ignore: autoconfigure springboot
cSpell:ignore: autoconfigure datasource logback springboot
---

You can use the [OpenTelemetry Java agent](..) with byte code instrumentation to
Expand All @@ -17,6 +17,10 @@ instrument your application.
The OpenTelemetry starter is compatible with Spring Boot 2.0 and 3.0, and Spring
native.

For an example Spring Boot Native image application that uses the OpenTelemetry
Spring Boot starter, see
[opentelemetry-java-examples/spring-native](https://github.com/open-telemetry/opentelemetry-java-examples/tree/main/spring-native).

## Configuration

Add the dependency given below to enable the OpenTelemetry starter.
Expand All @@ -37,7 +41,7 @@ auto-configuration, see the configuration [README].
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-spring-boot-starter</artifactId>
<version>{{% param vers.instrumentation %}}</version>
<version>{{% param vers.instrumentation %}}-alpha</version>
</dependency>
</dependencies>
```
Expand All @@ -46,13 +50,123 @@ auto-configuration, see the configuration [README].

```groovy
dependencies {
implementation('io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter:{{% param vers.instrumentation %}}')
implementation('io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter:{{% param vers.instrumentation %}}-alpha')
}
```

{{% /tab %}} {{< /tabpane>}}

## Additional instrumentations

You can configure additional instrumentations with
### JDBC Instrumentation

You have two ways to enable the JDBC instrumentation with the OpenTelemetry
starter.

If your application does not declare `DataSource` bean, you can update your
`application.properties` file to have the data source URL starting with
`jdbc:otel:` and set the driver class to
`io.opentelemetry.instrumentation.jdbc.OpenTelemetryDriver`.

```properties
spring.datasource.url=jdbc:otel:h2:mem:db
spring.datasource.driver-class-name=io.opentelemetry.instrumentation.jdbc.OpenTelemetryDriver
```

You can also wrap the `DataSource` bean in an
`io.opentelemetry.instrumentation.jdbc.datasource.OpenTelemetryDataSource`:

```java
import io.opentelemetry.instrumentation.jdbc.datasource.JdbcTelemetry;

@Configuration
public class DataSourceConfig {

@Bean
public DataSource dataSource(OpenTelemetry openTelemetry) {
DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
//Data source configurations
DataSource dataSource = dataSourceBuilder.build();
return JdbcTelemetry.create(openTelemetry).wrap(dataSource);
}

}
```

With the datasource configuration, you need to add the following dependency:

{{< tabpane text=true >}} {{% tab header="Maven (`pom.xml`)" lang=Maven %}}

```xml
<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-jdbc</artifactId>
<version>{{% param vers.instrumentation %}}-alpha</version>
</dependency>
</dependencies>
```

{{% /tab %}} {{% tab header="Gradle (`gradle.build`)" lang=Gradle %}}

```groovy
dependencies {
implementation('io.opentelemetry.instrumentation:opentelemetry-jdbc:{{% param vers.instrumentation %}}-alpha')
}
```

{{% /tab %}} {{< /tabpane>}}

### Logging Instrumentation

To enable the logging instrumentation for Logback you have to add the
OpenTelemetry appender in your `logback.xml` or `logback-spring.xml` file:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>
%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</pattern>
</encoder>
</appender>
<appender name="OpenTelemetry"
class="io.opentelemetry.instrumentation.logback.appender.v1_0.OpenTelemetryAppender">
</appender>
<root level="INFO">
<appender-ref ref="console"/>
<appender-ref ref="OpenTelemetry"/>
</root>
</configuration>
```

For Log4j 2, you have to add the OpenTelemetry appender to your `log4j2.xml`
file:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" packages="io.opentelemetry.instrumentation.log4j.appender.v2_17">
<Appenders>
<OpenTelemetry name="OpenTelemetryAppender"/>
</Appenders>
<Loggers>
<Root>
<AppenderRef ref="OpenTelemetryAppender" level="All"/>
</Root>
</Loggers>
</Configuration>
```

You can find more configuration options for the OpenTelemetry appender in the
documentation of the
[Logback](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/logback/logback-appender-1.0/library/README.md)
and
[Log4j](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/log4j/log4j-appender-2.17/library/README.md)
instrumentation libraries.

### Other Instrumentation

You can configure other instrumentations with
[OpenTelemetry instrumentations libraries](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md#libraries--frameworks).
Loading

0 comments on commit b0bb7f8

Please sign in to comment.