splunk-opentelemetry 2.0.0a2.dev0__tar.gz → 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- splunk_opentelemetry-2.1.0/.github/CODEOWNERS +9 -0
- splunk_opentelemetry-2.1.0/.github/dependabot.yml +25 -0
- splunk_opentelemetry-2.0.0a2.dev0/.github/workflows/test.yml → splunk_opentelemetry-2.1.0/.github/workflows/ci-main.yml +4 -4
- splunk_opentelemetry-2.1.0/.github/workflows/cla.yml +30 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/.gitlab-ci.yml +10 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/CHANGELOG.md +6 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/PKG-INFO +13 -15
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/README.md +4 -6
- splunk_opentelemetry-2.1.0/SECURITY.md +25 -0
- splunk_opentelemetry-2.1.0/VERSION_2_RELEASE_NOTES.md +89 -0
- splunk_opentelemetry-2.1.0/docker/Dockerfile +13 -0
- splunk_opentelemetry-2.1.0/docker/README.md +98 -0
- splunk_opentelemetry-2.1.0/docker/common.sh +73 -0
- splunk_opentelemetry-2.1.0/docker/example-instrumentation.yaml +14 -0
- splunk_opentelemetry-2.1.0/docker/install-docker-deps.sh +13 -0
- splunk_opentelemetry-2.1.0/docker/install-gh-deps.sh +10 -0
- splunk_opentelemetry-2.1.0/docker/publish-docker-image.sh +52 -0
- splunk_opentelemetry-2.1.0/docker/requirements.txt +1 -0
- splunk_opentelemetry-2.0.0a2.dev0/examples/splunk_opentelemetry.py → splunk_opentelemetry-2.1.0/examples/trace_example.py +2 -2
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/pyproject.toml +8 -8
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/src/splunk_otel/__about__.py +1 -12
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_lib.py +2 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_logging.py +2 -2
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_propagator.py +2 -2
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_trace_loop.py +2 -1
- splunk_opentelemetry-2.0.0a2.dev0/RELEASE_NOTES.md +0 -61
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/CODE_OF_CONDUCT.md +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/CONTRIBUTING.md +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/COPYRIGHT.txt +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/LICENSE.txt +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/src/splunk_otel/__init__.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/src/splunk_otel/configurator.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/src/splunk_otel/distro.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/src/splunk_otel/env.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/src/splunk_otel/profile.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/src/splunk_otel/profile_pb2.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/src/splunk_otel/propagator.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/__init__.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/fixtures/pb_profile.out.json +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/fixtures/stacktraces.in.json +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/fixtures/thread_states.in.json +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_http.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_init_otel.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_profile.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_sf_token.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_spec.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_svcname_unset.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_sysmetrics_disabled.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_sysmetrics_enabled.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/test_distro.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/test_env.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/test_profile.py +0 -0
- {splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/test_propagator.py +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
* @signalfx/gdi-python-maintainers @signalfx/gdi-python-approvers
|
|
2
|
+
|
|
3
|
+
#####################################################
|
|
4
|
+
#
|
|
5
|
+
# Docs reviewers
|
|
6
|
+
#
|
|
7
|
+
#####################################################
|
|
8
|
+
|
|
9
|
+
*.md @signalfx/gdi-docs @signalfx/gdi-python-maintainers @signalfx/gdi-python-approvers
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: github-actions
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "daily"
|
|
7
|
+
labels:
|
|
8
|
+
- "Skip Changelog"
|
|
9
|
+
- "dependencies"
|
|
10
|
+
- package-ecosystem: "pip"
|
|
11
|
+
directory: /
|
|
12
|
+
schedule:
|
|
13
|
+
interval: "daily"
|
|
14
|
+
labels:
|
|
15
|
+
- "Skip Changelog"
|
|
16
|
+
- "dependencies"
|
|
17
|
+
ignore:
|
|
18
|
+
- dependency-name: "opentelemetry-api"
|
|
19
|
+
- dependency-name: "opentelemetry-sdk"
|
|
20
|
+
- dependency-name: "opentelemetry-propagator-b3"
|
|
21
|
+
- dependency-name: "opentelemetry-exporter-otlp-proto-grpc"
|
|
22
|
+
- dependency-name: "opentelemetry-exporter-otlp-proto-http"
|
|
23
|
+
- dependency-name: "opentelemetry-instrumentation"
|
|
24
|
+
- dependency-name: "opentelemetry-instrumentation-system-metrics"
|
|
25
|
+
- dependency-name: "opentelemetry-semantic-conventions"
|
|
@@ -2,9 +2,9 @@ name: test
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
branches: [main
|
|
5
|
+
branches: [main]
|
|
6
6
|
pull_request:
|
|
7
|
-
branches: [main
|
|
7
|
+
branches: [main]
|
|
8
8
|
|
|
9
9
|
concurrency:
|
|
10
10
|
group: test-${{ github.head_ref }}
|
|
@@ -25,10 +25,10 @@ jobs:
|
|
|
25
25
|
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
|
|
26
26
|
|
|
27
27
|
steps:
|
|
28
|
-
- uses: actions/checkout@
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
29
|
|
|
30
30
|
- name: Set up Python ${{ matrix.python-version }}
|
|
31
|
-
uses: actions/setup-python@
|
|
31
|
+
uses: actions/setup-python@v5
|
|
32
32
|
with:
|
|
33
33
|
python-version: ${{ matrix.python-version }}
|
|
34
34
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: "CLA Assistant"
|
|
2
|
+
on:
|
|
3
|
+
issue_comment:
|
|
4
|
+
types: [created]
|
|
5
|
+
pull_request_target:
|
|
6
|
+
types: [opened, closed, synchronize]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
actions: write
|
|
10
|
+
contents: read
|
|
11
|
+
pull-requests: write
|
|
12
|
+
statuses: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
ContributorLicenseAgreement:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- name: "CLA Assistant"
|
|
19
|
+
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
|
20
|
+
uses: contributor-assistant/github-action@v2.6.1
|
|
21
|
+
env:
|
|
22
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
23
|
+
PERSONAL_ACCESS_TOKEN: ${{ secrets.PAT_CLATOOL }}
|
|
24
|
+
with:
|
|
25
|
+
remote-organization-name: splunk
|
|
26
|
+
remote-repository-name: cla-agreement
|
|
27
|
+
branch: main
|
|
28
|
+
path-to-signatures: signatures/version1/cla.json
|
|
29
|
+
path-to-document: https://github.com/splunk/cla-agreement/blob/main/CLA.md
|
|
30
|
+
allowlist: dependabot[bot]
|
|
@@ -10,6 +10,7 @@ stages:
|
|
|
10
10
|
- build
|
|
11
11
|
- sign
|
|
12
12
|
- deploy
|
|
13
|
+
- post-release
|
|
13
14
|
|
|
14
15
|
build-job:
|
|
15
16
|
stage: build
|
|
@@ -51,3 +52,12 @@ deploy-job:
|
|
|
51
52
|
except:
|
|
52
53
|
- branches
|
|
53
54
|
|
|
55
|
+
publish-docker-image:
|
|
56
|
+
stage: post-release
|
|
57
|
+
rules:
|
|
58
|
+
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(-alpha)?.*/'
|
|
59
|
+
before_script:
|
|
60
|
+
- ./docker/install-docker-deps.sh
|
|
61
|
+
- ./docker/install-gh-deps.sh
|
|
62
|
+
script:
|
|
63
|
+
- ./docker/publish-docker-image.sh "$CI_COMMIT_TAG"
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 2.1.0 - 2025-02-18
|
|
6
|
+
- Upgrade Otel dependencies to 1.30.0 / 0.51b0
|
|
7
|
+
|
|
8
|
+
## 2.0.0 - 2025-01-28
|
|
9
|
+
- See [VERSION_2_RELEASE_NOTES.md](VERSION_2_RELEASE_NOTES.md)
|
|
10
|
+
|
|
5
11
|
## 1.20.0 - 2024-08-08
|
|
6
12
|
- Upgrade Otel dependencies to 1.26.0 / 0.47b0
|
|
7
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: splunk-opentelemetry
|
|
3
|
-
Version: 2.0
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Project-URL: Documentation, https://github.com/signalfx/splunk-otel-python#readme
|
|
5
5
|
Project-URL: Issues, https://github.com/signalfx/splunk-otel-python/issues
|
|
6
6
|
Project-URL: Source, https://github.com/signalfx/splunk-otel-python
|
|
@@ -16,14 +16,14 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
16
16
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
17
17
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
18
18
|
Requires-Python: >=3.8
|
|
19
|
-
Requires-Dist: opentelemetry-api==1.
|
|
20
|
-
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc==1.
|
|
21
|
-
Requires-Dist: opentelemetry-exporter-otlp-proto-http==1.
|
|
22
|
-
Requires-Dist: opentelemetry-instrumentation-system-metrics==0.
|
|
23
|
-
Requires-Dist: opentelemetry-instrumentation==0.
|
|
24
|
-
Requires-Dist: opentelemetry-propagator-b3==1.
|
|
25
|
-
Requires-Dist: opentelemetry-sdk==1.
|
|
26
|
-
Requires-Dist: opentelemetry-semantic-conventions==0.
|
|
19
|
+
Requires-Dist: opentelemetry-api==1.30.0
|
|
20
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc==1.30.0
|
|
21
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http==1.30.0
|
|
22
|
+
Requires-Dist: opentelemetry-instrumentation-system-metrics==0.51b0
|
|
23
|
+
Requires-Dist: opentelemetry-instrumentation==0.51b0
|
|
24
|
+
Requires-Dist: opentelemetry-propagator-b3==1.30.0
|
|
25
|
+
Requires-Dist: opentelemetry-sdk==1.30.0
|
|
26
|
+
Requires-Dist: opentelemetry-semantic-conventions==0.51b0
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
|
|
29
29
|
# splunk-opentelemetry
|
|
@@ -42,17 +42,14 @@ tracer to capture and export trace spans.
|
|
|
42
42
|
|
|
43
43
|
This distribution comes with the following defaults:
|
|
44
44
|
|
|
45
|
-
- [W3C tracecontext](https://www.w3.org/TR/trace-context/) and [W3C baggage](https://www.w3.org/TR/baggage/)
|
|
46
|
-
context propagation;
|
|
47
|
-
[B3](https://github.com/openzipkin/b3-propagation) can also be
|
|
48
|
-
[configured](https://docs.splunk.com/Observability/gdi/get-data-in/application/python/configuration/advanced-python-otel-configuration.html).
|
|
49
45
|
- [OTLP gRPC exporter](https://opentelemetry-python.readthedocs.io/en/latest/exporter/otlp/otlp.html)
|
|
50
46
|
configured to send spans to a locally running
|
|
51
|
-
[Splunk OpenTelemetry
|
|
47
|
+
[Splunk OpenTelemetry Collector](https://github.com/signalfx/splunk-otel-collector)
|
|
52
48
|
(`http://localhost:4317`).
|
|
53
49
|
- Unlimited default limits for
|
|
54
50
|
[configuration options](https://docs.splunk.com/Observability/gdi/get-data-in/application/python/configuration/advanced-python-otel-configuration.html)
|
|
55
51
|
to support full-fidelity traces.
|
|
52
|
+
- Inclusion of [system metrics](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-system-metrics)
|
|
56
53
|
|
|
57
54
|
## Requirements
|
|
58
55
|
|
|
@@ -62,7 +59,8 @@ libraries are listed
|
|
|
62
59
|
|
|
63
60
|
## Get started
|
|
64
61
|
|
|
65
|
-
For complete instructions on how to get started with the Splunk Distribution of OpenTelemetry Python, see
|
|
62
|
+
For complete instructions on how to get started with the Splunk Distribution of OpenTelemetry Python, see
|
|
63
|
+
[Instrument a Python application for Splunk Observability Cloud](https://quickdraw.splunk.com/redirect/?product=Observability&version=current&location=python.application) in the official documentation.
|
|
66
64
|
|
|
67
65
|
|
|
68
66
|
# License
|
|
@@ -14,17 +14,14 @@ tracer to capture and export trace spans.
|
|
|
14
14
|
|
|
15
15
|
This distribution comes with the following defaults:
|
|
16
16
|
|
|
17
|
-
- [W3C tracecontext](https://www.w3.org/TR/trace-context/) and [W3C baggage](https://www.w3.org/TR/baggage/)
|
|
18
|
-
context propagation;
|
|
19
|
-
[B3](https://github.com/openzipkin/b3-propagation) can also be
|
|
20
|
-
[configured](https://docs.splunk.com/Observability/gdi/get-data-in/application/python/configuration/advanced-python-otel-configuration.html).
|
|
21
17
|
- [OTLP gRPC exporter](https://opentelemetry-python.readthedocs.io/en/latest/exporter/otlp/otlp.html)
|
|
22
18
|
configured to send spans to a locally running
|
|
23
|
-
[Splunk OpenTelemetry
|
|
19
|
+
[Splunk OpenTelemetry Collector](https://github.com/signalfx/splunk-otel-collector)
|
|
24
20
|
(`http://localhost:4317`).
|
|
25
21
|
- Unlimited default limits for
|
|
26
22
|
[configuration options](https://docs.splunk.com/Observability/gdi/get-data-in/application/python/configuration/advanced-python-otel-configuration.html)
|
|
27
23
|
to support full-fidelity traces.
|
|
24
|
+
- Inclusion of [system metrics](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-system-metrics)
|
|
28
25
|
|
|
29
26
|
## Requirements
|
|
30
27
|
|
|
@@ -34,7 +31,8 @@ libraries are listed
|
|
|
34
31
|
|
|
35
32
|
## Get started
|
|
36
33
|
|
|
37
|
-
For complete instructions on how to get started with the Splunk Distribution of OpenTelemetry Python, see
|
|
34
|
+
For complete instructions on how to get started with the Splunk Distribution of OpenTelemetry Python, see
|
|
35
|
+
[Instrument a Python application for Splunk Observability Cloud](https://quickdraw.splunk.com/redirect/?product=Observability&version=current&location=python.application) in the official documentation.
|
|
38
36
|
|
|
39
37
|
|
|
40
38
|
# License
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
## Reporting Security Issues
|
|
4
|
+
|
|
5
|
+
Please *DO NOT* report security vulnerabilities with public GitHub issue
|
|
6
|
+
reports. Please [report security issues here](
|
|
7
|
+
https://www.splunk.com/en_us/product-security/report.html).
|
|
8
|
+
|
|
9
|
+
## Dependencies
|
|
10
|
+
|
|
11
|
+
This project relies on a variety of external dependencies.
|
|
12
|
+
These dependencies are monitored by
|
|
13
|
+
[Dependabot](https://docs.github.com/en/code-security/supply-chain-security/configuring-dependabot-security-updates).
|
|
14
|
+
Dependencies are [checked
|
|
15
|
+
daily](https://github.com/signalfx/splunk-otel-python/blob/main/.github/dependabot.yml)
|
|
16
|
+
and associated pull requests are opened automatically. Upgrading to the [latest
|
|
17
|
+
release](https://github.com/signalfx/splunk-otel-python/releases)
|
|
18
|
+
is recommended to ensure you have the latest security updates. If a security
|
|
19
|
+
vulnerability is detected for a dependency of this project then either:
|
|
20
|
+
|
|
21
|
+
- You are running an older release
|
|
22
|
+
- A new release with the updates has not been cut yet
|
|
23
|
+
- The updated dependency has not been merged likely due to some breaking change
|
|
24
|
+
(in this case, we will actively work to resolve the issue)
|
|
25
|
+
- The dependency has not released an updated version with the patch
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Release Notes for Splunk OTel Python Version 2
|
|
2
|
+
|
|
3
|
+
Summary of changes between Splunk OTel Python major versions 1 and 2.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Version 2 of the Splunk Distribution of Opentelemetry Python represents a significant rewrite of the distribution,
|
|
8
|
+
including a new build system using Hatch, matching the upstream Opentelemetry Python repository. As the upstream
|
|
9
|
+
repository has become more mature since Splunk OTel Python 1.0 was released, version 2 has adopted
|
|
10
|
+
a smaller footprint, deferring logic and spec compliance to the upstream project, while making vendor-specific features
|
|
11
|
+
available for your convenience to send telemetry to Splunk Observability Cloud.
|
|
12
|
+
|
|
13
|
+
## API
|
|
14
|
+
|
|
15
|
+
### Version 1
|
|
16
|
+
|
|
17
|
+
| Function name | Operation | Arguments |
|
|
18
|
+
|-------------------|-------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
|
19
|
+
| `start_metrics()` | Configures metrics (sets up meter provider, SystemMetricsInstrumentor, and otlp exporter) | None |
|
|
20
|
+
| `start_tracing()` | Configures tracing (sets up tracer provider, batch span processor, and exporter) | service_name, span_exporter_factories, access_token, resource_attributes, trace_response_header_enabled |
|
|
21
|
+
|
|
22
|
+
### Version 2
|
|
23
|
+
|
|
24
|
+
| Function name | Operation | Arguments |
|
|
25
|
+
|----------------------|----------------------------------------|-----------|
|
|
26
|
+
| `init_splunk_otel()` | Initializes tracing, metrics, and logs | None |
|
|
27
|
+
|
|
28
|
+
## Environment Variables
|
|
29
|
+
|
|
30
|
+
| Variable | Default | Description |
|
|
31
|
+
|--------------------------------------------------|-----------|------------------------------------------------------------------------------------------------------|
|
|
32
|
+
| SPLUNK_ACCESS_TOKEN | | Adds token to requests to enable direct ingest (for skipping the Collector) |
|
|
33
|
+
| SPLUNK_REALM | | Sets the metrics and traces endpoints by realm (e.g. `us1`) and sets the protocol to `http/protobuf` |
|
|
34
|
+
| SPLUNK_PROFILER_ENABLED | false | Configures the Splunk profiler to start polling at startup |
|
|
35
|
+
| SPLUNK_TRACE_RESPONSE_HEADER_ENABLED | true | Configures injection of tracecontext headers into HTTP responses if true |
|
|
36
|
+
| SPLUNK_PROFILER_CALL_STACK_INTERVAL | 1000 | Sets the profiler poll interval, in milliseconds |
|
|
37
|
+
| SPLUNK_PROFILER_LOGS_ENDPOINT | | Sets the OTel logging endpoint, only if profiler is enabled |
|
|
38
|
+
| OTEL_METRICS_EXPORTER | otlp | Sets the metrics exporter |
|
|
39
|
+
| OTEL_TRACES_EXPORTER | otlp | Sets the traces exporter |
|
|
40
|
+
| OTEL_LOGS_EXPORTER | otlp | Sets the logs exporter |
|
|
41
|
+
| OTEL_EXPERIMENTAL_RESOURCE_DETECTORS | host | Configures a host resource detector to set telemetry attributes |
|
|
42
|
+
| OTEL_TRACES_SAMPLER | always_on | Configures the sampler to export all traces |
|
|
43
|
+
| OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED | true | Exports all logs |
|
|
44
|
+
| OTEL_SPAN_LINK_COUNT_LIMIT | 1000 | Sets the maximum allowed span link count |
|
|
45
|
+
| OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT | 12000 | Sets the maximum allowed attribute value size |
|
|
46
|
+
| OTEL_ATTRIBUTE_COUNT_LIMIT | _empty_ | |
|
|
47
|
+
| OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT | _empty_ | |
|
|
48
|
+
| OTEL_SPAN_EVENT_COUNT_LIMIT | _empty_ | |
|
|
49
|
+
| OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT | _empty_ | |
|
|
50
|
+
| OTEL_LINK_ATTRIBUTE_COUNT_LIMIT | _empty_ | |
|
|
51
|
+
|
|
52
|
+
## Environment Variable Changes Between 1.x and 2.x
|
|
53
|
+
|
|
54
|
+
| Variable | Changes in 2.x |
|
|
55
|
+
|--------------------------------------|---------------------------------------------------------------------------------|
|
|
56
|
+
| OTEL_METRICS_ENABLED | Removed (set `OTEL_PYTHON_DISABLED_INSTRUMENTATIONS=system_metrics` to disable) |
|
|
57
|
+
| OTEL_METRICS_EXPORTER | Overridden in 1.x, configurable in 2.x |
|
|
58
|
+
| OTEL_TRACE_ENABLED | Removed (defaulted to `true`) |
|
|
59
|
+
| OTEL_PYTHON_LOG_CORRELATION | No longer set (previously reformatted logs, adding trace IDs) |
|
|
60
|
+
| OTEL_METRICS_EXPORTER | Added |
|
|
61
|
+
| OTEL_LOGS_EXPORTER | Added |
|
|
62
|
+
| OTEL_EXPERIMENTAL_RESOURCE_DETECTORS | Added |
|
|
63
|
+
| OTEL_TRACES_SAMPLER | Added (previously defaulted to `parentbased_always_on`) |
|
|
64
|
+
|
|
65
|
+
## Auto-instrumentation
|
|
66
|
+
|
|
67
|
+
Version 1 of Splunk OTel Python supplied a script to run a python application with OTel auto instrumentation. For
|
|
68
|
+
example:
|
|
69
|
+
|
|
70
|
+
`$ splunk-py-trace python myapp.py`
|
|
71
|
+
|
|
72
|
+
In version 2 of Splunk OTel Python, the `splunk-py-trace` command is replaced by `opentelemetry-instrument`, the same
|
|
73
|
+
command supplied by the core OpenTelemetry Python project.
|
|
74
|
+
|
|
75
|
+
| Version | Commands |
|
|
76
|
+
|---------|------------------------------------|
|
|
77
|
+
| 1.x | `splunk-py-trace`, `splk-py-trace` |
|
|
78
|
+
| 2.x | `opentelemetry-instrument` |
|
|
79
|
+
|
|
80
|
+
## Bootstrap Script
|
|
81
|
+
|
|
82
|
+
Version 1 of Splunk OTel Python supplied a script to install instrumentation libraries based on the packages
|
|
83
|
+
already installed in the current environment. In version 2 the `splunk-py-trace-bootstrap` command is replaced by
|
|
84
|
+
`opentelemetry-bootstrap`, the same command supplied by the core OpenTelemetry Python project.
|
|
85
|
+
|
|
86
|
+
| Version | Commands |
|
|
87
|
+
|---------|--------------------------------------------------------|
|
|
88
|
+
| 1.x | `splunk-py-trace-bootstrap`, `splk-py-trace-bootstrap` |
|
|
89
|
+
| 2.x | `opentelemetry-bootstrap` |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
FROM python:3.11 AS build
|
|
2
|
+
|
|
3
|
+
WORKDIR /operator-build
|
|
4
|
+
|
|
5
|
+
ADD requirements.txt .
|
|
6
|
+
|
|
7
|
+
RUN mkdir workspace && pip install --target workspace -r requirements.txt
|
|
8
|
+
|
|
9
|
+
FROM busybox
|
|
10
|
+
|
|
11
|
+
COPY --from=build /operator-build/workspace /autoinstrumentation
|
|
12
|
+
|
|
13
|
+
RUN chmod -R go+r /autoinstrumentation
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
This directory contains a Dockerfile and an `example-instrumentation.yaml` file for creating a
|
|
4
|
+
Docker init container that can be used to auto-instrumetation your Python app via the kubernetes
|
|
5
|
+
[OTel Operator](https://github.com/open-telemetry/opentelemetry-operator).
|
|
6
|
+
|
|
7
|
+
# Installation
|
|
8
|
+
|
|
9
|
+
Install [cert manager](https://cert-manager.io/docs/installation/) into your k8s cluster unless already installed.
|
|
10
|
+
|
|
11
|
+
Install the OTel Operator Custom Resource Definitions:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yaml
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Install an _OpenTelemetryCollector_ definition into the k8s cluster. The following defines a Collector sidecar that
|
|
18
|
+
just prints debug statements.
|
|
19
|
+
|
|
20
|
+
```yaml
|
|
21
|
+
apiVersion: opentelemetry.io/v1beta1
|
|
22
|
+
kind: OpenTelemetryCollector
|
|
23
|
+
metadata:
|
|
24
|
+
name: my-sidecar
|
|
25
|
+
spec:
|
|
26
|
+
mode: sidecar
|
|
27
|
+
config:
|
|
28
|
+
receivers:
|
|
29
|
+
otlp:
|
|
30
|
+
protocols:
|
|
31
|
+
grpc:
|
|
32
|
+
endpoint: 0.0.0.0:4317
|
|
33
|
+
http:
|
|
34
|
+
endpoint: 0.0.0.0:4318
|
|
35
|
+
exporters:
|
|
36
|
+
debug: {}
|
|
37
|
+
service:
|
|
38
|
+
pipelines:
|
|
39
|
+
traces:
|
|
40
|
+
receivers: [otlp]
|
|
41
|
+
exporters: [debug]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Install an _Instrumentation_ definition. It will be activated when you create an app with an `inject-python` annotation,
|
|
45
|
+
running an _init_ container before your Python app. The init container makes OTel libraries (including a
|
|
46
|
+
`sitecustomize.py`) available at `/otel-auto-instrumentation-python` and sets the PYTHONPATH for the starting
|
|
47
|
+
application.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
```yaml
|
|
51
|
+
apiVersion: opentelemetry.io/v1alpha1
|
|
52
|
+
kind: Instrumentation
|
|
53
|
+
metadata:
|
|
54
|
+
name: splunk-otel-python
|
|
55
|
+
spec:
|
|
56
|
+
exporter:
|
|
57
|
+
endpoint: http://localhost:4318
|
|
58
|
+
sampler:
|
|
59
|
+
type: always_on
|
|
60
|
+
python:
|
|
61
|
+
env:
|
|
62
|
+
- name: OTEL_EXPORTER_OTLP_PROTOCOL
|
|
63
|
+
value: http/protobuf
|
|
64
|
+
image: "splunk-otel-python-init:v2.0.0"
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Create an application image and run it via something like this Deployment. Note the annotations, indicating that
|
|
69
|
+
we want both Python auto instrumentation installed and our sidecar Collector to run.
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
apiVersion: apps/v1
|
|
73
|
+
kind: Deployment
|
|
74
|
+
metadata:
|
|
75
|
+
name: ticker
|
|
76
|
+
spec:
|
|
77
|
+
selector:
|
|
78
|
+
matchLabels:
|
|
79
|
+
app: ticker
|
|
80
|
+
replicas: 1
|
|
81
|
+
template:
|
|
82
|
+
metadata:
|
|
83
|
+
labels:
|
|
84
|
+
app: ticker
|
|
85
|
+
annotations:
|
|
86
|
+
sidecar.opentelemetry.io/inject: "true"
|
|
87
|
+
instrumentation.opentelemetry.io/inject-python: "true"
|
|
88
|
+
spec:
|
|
89
|
+
containers:
|
|
90
|
+
- name: ticker
|
|
91
|
+
image: ticker:v1
|
|
92
|
+
env:
|
|
93
|
+
- name: PYTHONUNBUFFERED
|
|
94
|
+
value: "1"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
When you run this application, k8s should create a pod with a Collector sidecar and auto instrumentation enabled. You
|
|
98
|
+
can check the Collector logs to make sure it's receiving data.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Common functions used during the release process on GitLab
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
setup_gpg() {
|
|
8
|
+
echo ">>> Setting GnuPG configuration ..."
|
|
9
|
+
mkdir -p ~/.gnupg
|
|
10
|
+
chmod 700 ~/.gnupg
|
|
11
|
+
cat > ~/.gnupg/gpg.conf <<EOF
|
|
12
|
+
no-tty
|
|
13
|
+
pinentry-mode loopback
|
|
14
|
+
EOF
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
import_gpg_secret_key() {
|
|
18
|
+
local secret_key_contents="$1"
|
|
19
|
+
|
|
20
|
+
echo ">>> Importing secret key ..."
|
|
21
|
+
echo "$secret_key_contents" > seckey.gpg
|
|
22
|
+
if (gpg --batch --allow-secret-key-import --import seckey.gpg)
|
|
23
|
+
then
|
|
24
|
+
rm seckey.gpg
|
|
25
|
+
else
|
|
26
|
+
rm seckey.gpg
|
|
27
|
+
exit 1
|
|
28
|
+
fi
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
sign_file() {
|
|
32
|
+
local file="$1"
|
|
33
|
+
echo "$GPG_PASSWORD" | \
|
|
34
|
+
gpg --batch --passphrase-fd 0 --armor --local-user="$GPG_KEY_ID" --detach-sign "$file"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
setup_git() {
|
|
38
|
+
git config --global user.name release-bot
|
|
39
|
+
git config --global user.email ssg-srv-gh-o11y-gdi@splunk.com
|
|
40
|
+
git config --global gpg.program gpg
|
|
41
|
+
git config --global user.signingKey "$GITHUB_BOT_GPG_KEY_ID"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
# input must include starting 'v'.
|
|
45
|
+
# this strips it and returns version minus leading v.
|
|
46
|
+
get_release_version() {
|
|
47
|
+
local release_tag="$1"
|
|
48
|
+
echo "$release_tag" | cut -c2-
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
# 1 from v1.2.3
|
|
52
|
+
get_major_version() {
|
|
53
|
+
local release_tag="$1"
|
|
54
|
+
get_release_version "$release_tag" | awk -F'.' '{print $1}'
|
|
55
|
+
}
|
|
56
|
+
get_minor_version() {
|
|
57
|
+
local release_tag="$1"
|
|
58
|
+
get_release_version "$release_tag" | awk -F'.' '{print $2}'
|
|
59
|
+
}
|
|
60
|
+
get_patch_version() {
|
|
61
|
+
local release_tag="$1"
|
|
62
|
+
get_release_version "$release_tag" | awk -F'[.-]' '{print $3}'
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
validate_version() {
|
|
66
|
+
local version="$1"
|
|
67
|
+
if [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-.*)?$ ]]
|
|
68
|
+
then
|
|
69
|
+
echo "Invalid release version: $version"
|
|
70
|
+
echo "Release version must follow the pattern major.minor.patch, e.g. 1.2.3"
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
73
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
apiVersion: opentelemetry.io/v1alpha1
|
|
2
|
+
kind: Instrumentation
|
|
3
|
+
metadata:
|
|
4
|
+
name: splunk-otel-python
|
|
5
|
+
spec:
|
|
6
|
+
exporter:
|
|
7
|
+
endpoint: http://localhost:4318
|
|
8
|
+
sampler:
|
|
9
|
+
type: always_on
|
|
10
|
+
python:
|
|
11
|
+
env:
|
|
12
|
+
- name: OTEL_EXPORTER_OTLP_PROTOCOL
|
|
13
|
+
value: http/protobuf
|
|
14
|
+
image: "splunk-otel-instrumentation-python:v2.1.0"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
apt-get update
|
|
6
|
+
apt-get -y install ca-certificates curl gnupg lsb-release
|
|
7
|
+
|
|
8
|
+
# install docker
|
|
9
|
+
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
|
10
|
+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
11
|
+
|
|
12
|
+
apt-get update
|
|
13
|
+
apt-get -y install docker-ce docker-ce-cli containerd.io
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
# instructions from https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-apt
|
|
6
|
+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
|
|
7
|
+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
|
|
8
|
+
|
|
9
|
+
apt update
|
|
10
|
+
apt install -y zip gh
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
# NOTE: this script is meant to be run on GitLab CI, as it depends on GitLab CI variables
|
|
5
|
+
|
|
6
|
+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
7
|
+
|
|
8
|
+
source "${SCRIPT_DIR}/common.sh"
|
|
9
|
+
|
|
10
|
+
ROOT_DIR="${SCRIPT_DIR}/../"
|
|
11
|
+
cd "${ROOT_DIR}"
|
|
12
|
+
|
|
13
|
+
print_usage() {
|
|
14
|
+
cat <<EOF
|
|
15
|
+
Usage: $(basename "$0") tag"
|
|
16
|
+
|
|
17
|
+
Tag example: v1.2.3
|
|
18
|
+
EOF
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if [[ $# != 1 ]]
|
|
22
|
+
then
|
|
23
|
+
print_usage
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
release_tag="$1"
|
|
28
|
+
|
|
29
|
+
build_docker_image() {
|
|
30
|
+
echo ">>> Building the operator docker image ..."
|
|
31
|
+
cd docker
|
|
32
|
+
docker build -t splunk-otel-instrumentation-python .
|
|
33
|
+
docker tag splunk-otel-instrumentation-python quay.io/signalfx/splunk-otel-instrumentation-python:latest
|
|
34
|
+
docker tag splunk-otel-instrumentation-python "quay.io/signalfx/splunk-otel-instrumentation-python:v$(get_major_version "$release_tag")"
|
|
35
|
+
docker tag splunk-otel-instrumentation-python "quay.io/signalfx/splunk-otel-instrumentation-python:$release_tag"
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
login_to_quay_io() {
|
|
39
|
+
echo ">>> Logging into quay.io ..."
|
|
40
|
+
docker login -u "$QUAY_USERNAME" -p "$QUAY_PASSWORD" quay.io
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
publish_docker_image() {
|
|
44
|
+
echo ">>> Publishing the operator docker image ..."
|
|
45
|
+
docker push quay.io/signalfx/splunk-otel-instrumentation-python:latest
|
|
46
|
+
docker push "quay.io/signalfx/splunk-otel-instrumentation-python:v$(get_major_version "$release_tag")"
|
|
47
|
+
docker push "quay.io/signalfx/splunk-otel-instrumentation-python:$release_tag"
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
build_docker_image
|
|
51
|
+
login_to_quay_io
|
|
52
|
+
publish_docker_image
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
splunk-opentelemetry==2.1.0
|
|
@@ -8,9 +8,9 @@ from splunk_otel.env import SPLUNK_ACCESS_TOKEN, SPLUNK_REALM
|
|
|
8
8
|
|
|
9
9
|
os.environ[OTEL_SERVICE_NAME] = "my-svc"
|
|
10
10
|
os.environ[SPLUNK_REALM] = "us1"
|
|
11
|
-
os.environ[SPLUNK_ACCESS_TOKEN] = "
|
|
11
|
+
os.environ[SPLUNK_ACCESS_TOKEN] = "abc123"
|
|
12
12
|
|
|
13
|
-
# The `init_splunk_otel`
|
|
13
|
+
# The `init_splunk_otel` function configures OTel metrics, traces, and logs.
|
|
14
14
|
init_splunk_otel()
|
|
15
15
|
|
|
16
16
|
tracer = trace.get_tracer("my-tracer")
|
|
@@ -23,14 +23,14 @@ classifiers = [
|
|
|
23
23
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
24
24
|
]
|
|
25
25
|
dependencies = [
|
|
26
|
-
"opentelemetry-api==1.
|
|
27
|
-
"opentelemetry-sdk==1.
|
|
28
|
-
"opentelemetry-propagator-b3==1.
|
|
29
|
-
"opentelemetry-exporter-otlp-proto-grpc==1.
|
|
30
|
-
"opentelemetry-exporter-otlp-proto-http==1.
|
|
31
|
-
"opentelemetry-instrumentation==0.
|
|
32
|
-
"opentelemetry-instrumentation-system-metrics==0.
|
|
33
|
-
"opentelemetry-semantic-conventions==0.
|
|
26
|
+
"opentelemetry-api==1.30.0",
|
|
27
|
+
"opentelemetry-sdk==1.30.0",
|
|
28
|
+
"opentelemetry-propagator-b3==1.30.0",
|
|
29
|
+
"opentelemetry-exporter-otlp-proto-grpc==1.30.0",
|
|
30
|
+
"opentelemetry-exporter-otlp-proto-http==1.30.0",
|
|
31
|
+
"opentelemetry-instrumentation==0.51b0",
|
|
32
|
+
"opentelemetry-instrumentation-system-metrics==0.51b0",
|
|
33
|
+
"opentelemetry-semantic-conventions==0.51b0",
|
|
34
34
|
]
|
|
35
35
|
|
|
36
36
|
[project.urls]
|
{splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/src/splunk_otel/__about__.py
RENAMED
|
@@ -13,15 +13,4 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
__version__ = "2.0
|
|
17
|
-
"""
|
|
18
|
-
explanation:
|
|
19
|
-
2.0.0a1 (alpha release 1 of version 2.0.0)
|
|
20
|
-
2.0.0a1.dev0 (development version zero of the next release)
|
|
21
|
-
2.0.0b1 (beta release 1 of version 2.0.0)
|
|
22
|
-
2.0.0rc1 (release candidate 1 of version 2.0.0)
|
|
23
|
-
|
|
24
|
-
installation:
|
|
25
|
-
pip install --pre splunk-opentelemetry
|
|
26
|
-
pip install splunk-opentelemetry==2.0.0a1
|
|
27
|
-
"""
|
|
16
|
+
__version__ = "2.1.0"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
3
|
from opentelemetry import trace
|
|
4
|
-
from ott_lib import project_path
|
|
4
|
+
from ott_lib import UPSTREAM_PRERELEASE_VERSION, project_path
|
|
5
5
|
|
|
6
6
|
MESSAGE = "uh oh!"
|
|
7
7
|
LOGGER_NAME = "logging-ott"
|
|
@@ -17,7 +17,7 @@ if __name__ == "__main__":
|
|
|
17
17
|
|
|
18
18
|
class LoggingOtelTest:
|
|
19
19
|
def requirements(self):
|
|
20
|
-
return project_path(), "opentelemetry-instrumentation-logging==
|
|
20
|
+
return project_path(), f"opentelemetry-instrumentation-logging=={UPSTREAM_PRERELEASE_VERSION}"
|
|
21
21
|
|
|
22
22
|
def environment_variables(self):
|
|
23
23
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Mapping, Optional, Sequence
|
|
2
2
|
|
|
3
3
|
from oteltest import OtelTest, Telemetry
|
|
4
|
-
from ott_lib import project_path
|
|
4
|
+
from ott_lib import UPSTREAM_PRERELEASE_VERSION, project_path
|
|
5
5
|
|
|
6
6
|
PORT = 8888
|
|
7
7
|
|
|
@@ -35,7 +35,7 @@ class OTT(OtelTest):
|
|
|
35
35
|
project_path(),
|
|
36
36
|
"oteltest",
|
|
37
37
|
"flask",
|
|
38
|
-
"opentelemetry-instrumentation-flask",
|
|
38
|
+
f"opentelemetry-instrumentation-flask=={UPSTREAM_PRERELEASE_VERSION}",
|
|
39
39
|
]
|
|
40
40
|
|
|
41
41
|
def wrapper_command(self) -> str:
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
from oteltest.telemetry import count_spans, extract_leaves, get_attribute
|
|
2
1
|
from ott_lib import project_path, trace_loop
|
|
3
2
|
|
|
4
3
|
NUM_SPANS = 12
|
|
@@ -23,6 +22,8 @@ class NumSpansOtelTest:
|
|
|
23
22
|
return None
|
|
24
23
|
|
|
25
24
|
def on_stop(self, telemetry, stdout: str, stderr: str, returncode: int) -> None:
|
|
25
|
+
from oteltest.telemetry import count_spans, extract_leaves, get_attribute
|
|
26
|
+
|
|
26
27
|
assert count_spans(telemetry) == NUM_SPANS
|
|
27
28
|
|
|
28
29
|
attributes = extract_leaves(telemetry, "trace_requests", "pbreq", "resource_spans", "resource", "attributes")
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# Release Notes for Splunk OTel Python Version 2
|
|
2
|
-
|
|
3
|
-
Summary of changes between Splunk OTel Python major versions 1 and 2.
|
|
4
|
-
|
|
5
|
-
## API
|
|
6
|
-
|
|
7
|
-
### Version 1
|
|
8
|
-
|
|
9
|
-
| Function name | Operation | Arguments |
|
|
10
|
-
|-------------------|-------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
|
11
|
-
| `start_metrics()` | Configures metrics (sets up meter provider, SystemMetricsInstrumentor, and otlp exporter) | None |
|
|
12
|
-
| `start_tracing()` | Configures tracing (sets up tracer provider, batch span processor, and exporter) | service_name, span_exporter_factories, access_token, resource_attributes, trace_response_header_enabled |
|
|
13
|
-
|
|
14
|
-
### Version 2
|
|
15
|
-
|
|
16
|
-
| Function name | Operation | Arguments |
|
|
17
|
-
|----------------------|----------------------------------------|-----------|
|
|
18
|
-
| `init_splunk_otel()` | Initializes tracing, metrics, and logs | None |
|
|
19
|
-
|
|
20
|
-
## Environment Variables
|
|
21
|
-
|
|
22
|
-
| Variable | v2 default | v1 -> v2 changes | Description |
|
|
23
|
-
|---------------------------------------|------------|---------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
|
|
24
|
-
| SPLUNK_ACCESS_TOKEN | | None | Adds token to requests to enable direct ingest (for skipping the collector) |
|
|
25
|
-
| OTEL_METRICS_ENABLED | [n/a] | Removed. Set `OTEL_PYTHON_DISABLED_INSTRUMENTATIONS=system_metrics` to disable. | Caused metrics to be configured (with an otlp-grpc metric exporter and a SystemMetricInstrumentor) |
|
|
26
|
-
| OTEL_METRICS_EXPORTER | otlp | Hard coded in v1, configurable in v2 | Indicates the metrics exporter |
|
|
27
|
-
| OTEL_TRACE_ENABLED | true | None | Causes tracing to be configured and instrumentors loaded |
|
|
28
|
-
| OTEL_TRACES_EXPORTER | otlp | None | Indicates the traces exporter |
|
|
29
|
-
| OTEL_PYTHON_DISABLED_INSTRUMENTATIONS | | None | Disables instrumentations by entrypoint name |
|
|
30
|
-
| SPLUNK_PROFILER_ENABLED | false | None | Causes the Splunk profiler to start polling at startup |
|
|
31
|
-
| OTEL_SPAN_LINK_COUNT_LIMIT | 1000 | None | Sets the maximum allowed span link count |
|
|
32
|
-
| OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT | 12000 | None | Sets the maximum allowed attribute value size |
|
|
33
|
-
| SPLUNK_TRACE_RESPONSE_HEADER_ENABLED | true | None | Causes a ServerTimingReponsePropagator to be configured if true (injects tracecontext headers into HTTP responses) |
|
|
34
|
-
| OTEL_EXPERIMENTAL_RESOURCE_DETECTORS | host | Not set in v1 | Causes a host resource detector to be configured to set telemetry attributes |
|
|
35
|
-
| OTEL_TRACES_SAMPLER | always_on | Not set in v1 (took upstream default of parentbased_always_on) | |
|
|
36
|
-
|
|
37
|
-
## Auto-instrumentation
|
|
38
|
-
|
|
39
|
-
Version 1 of Splunk OTel Python supplied a script to run a python application with OTel auto instrumentation. For
|
|
40
|
-
example:
|
|
41
|
-
|
|
42
|
-
`$ splunk-py-trace python myapp.apy`
|
|
43
|
-
|
|
44
|
-
In version 2 of Splunk OTel Python, the `splunk-py-trace` command is replaced by `opentelemetry-instrument`, the same
|
|
45
|
-
command supplied by the core OpenTelemetry Python project.
|
|
46
|
-
|
|
47
|
-
| Version | Commands |
|
|
48
|
-
|---------|------------------------------------|
|
|
49
|
-
| 1.x | `splunk-py-trace`, `splk-py-trace` |
|
|
50
|
-
| 2.x | `opentelemetry-instrument` |
|
|
51
|
-
|
|
52
|
-
## Bootstrap Script
|
|
53
|
-
|
|
54
|
-
Version 1 of Splunk OTel Python supplied a script to install instrumentation libraries based on the packages
|
|
55
|
-
already installed in the current environment. In version 2 the `splunk-py-trace-bootstrap` command is replaced by
|
|
56
|
-
`opentelemetry-bootstrap`, the same command supplied by the core OpenTelemetry Python project.
|
|
57
|
-
|
|
58
|
-
| Version | Commands |
|
|
59
|
-
|---------|--------------------------------------------------------|
|
|
60
|
-
| 1.x | `splunk-py-trace-bootstrap`, `splk-py-trace-bootstrap` |
|
|
61
|
-
| 2.x | `opentelemetry-bootstrap` |
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/src/splunk_otel/__init__.py
RENAMED
|
File without changes
|
{splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/src/splunk_otel/configurator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/src/splunk_otel/profile_pb2.py
RENAMED
|
File without changes
|
{splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/src/splunk_otel/propagator.py
RENAMED
|
File without changes
|
|
File without changes
|
{splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/fixtures/pb_profile.out.json
RENAMED
|
File without changes
|
{splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/fixtures/stacktraces.in.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_sysmetrics_disabled.py
RENAMED
|
File without changes
|
{splunk_opentelemetry-2.0.0a2.dev0 → splunk_opentelemetry-2.1.0}/tests/ott_sysmetrics_enabled.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|