Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 541eb89

Browse files
Merge pull request #2583 from splunk/urbiz-OD6978-authbearext
[6978]: Doc bearertokenauth extension
2 parents 4ccc4fc + f64fdb7 commit 541eb89

File tree

2 files changed

+106
-4
lines changed

2 files changed

+106
-4
lines changed

gdi/opentelemetry/components/basic-auth-extension.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Get started
2121

2222
Follow these steps to configure and activate the component:
2323

24-
1. Deploy the Splunk Distribution of OpenTelemetry Collector to your host or container platform:
24+
1. Deploy the Splunk Distribution of the OpenTelemetry Collector to your host or container platform:
2525

2626
- :ref:`otel-install-linux`
2727
- :ref:`otel-install-windows`
@@ -33,7 +33,7 @@ Follow these steps to configure and activate the component:
3333
Sample configurations
3434
--------------------------------------------
3535

36-
To activate the resource processor, add ``basicauth`` to the ``extensions`` section of your configuration file, as shown in the following example:
36+
To activate this component add ``basicauth`` to the ``extensions`` section of your configuration file, as shown in the following example:
3737

3838
.. code:: yaml
3939

gdi/opentelemetry/components/bearertokenauth-extension.rst

Lines changed: 104 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,109 @@ Authenticator - Bearer extension
77
.. meta::
88
:description: Implements both ``configauth.ServerAuthenticator`` and ``configauth.ClientAuthenticator``. It can be used in both http and gRPC exporters inside the ``auth`` settings to embed a static token for every RPC call made.
99

10-
The Splunk Distribution of the OpenTelemetry Collector supports the Authenticator - Bearer extension. Documentation is planned for a future release.
10+
The ``bearertokenauth`` extension implements both ``configauth.ServerAuthenticator`` and ``configauth.ClientAuthenticator``. It can be used in both http and gRPC exporters inside the ``auth`` settings to embed a static token for every RPC call made.
11+
12+
The following is required:
13+
14+
* You need to set the authenticator type to ``bearertokenauth``.
15+
16+
* You need to enable transport layer security on the exporter.
17+
18+
Get started
19+
======================
20+
21+
Follow these steps to configure and activate the component:
22+
23+
1. Deploy the Splunk Distribution of the OpenTelemetry Collector to your host or container platform:
24+
25+
- :ref:`otel-install-linux`
26+
- :ref:`otel-install-windows`
27+
- :ref:`otel-install-k8s`
28+
29+
2. Configure the ``bearertokenauth`` extension as described in the next section.
30+
3. Restart the Collector.
31+
32+
Configuration options
33+
--------------------------------------------
34+
35+
The following configuration options are available:
36+
37+
* ``filename``. Name of file that contains the authorization token sent in every client call.
38+
39+
* ``token``. Static authorization token sent on every gRPC client call as metadata. The value of the token is prepended by ``${scheme}`` before being sent as a value of the authorization key in the request header (for HTTP) and metadata (for gRPC).
40+
41+
.. note:: Either ``filename`` or ``token`` are required. If both are specified, then the ``token`` field value is ignored.
42+
43+
Optionally, you can also configure:
44+
45+
* ``scheme``. ``Bearer`` by default. Specifies the auth scheme name.
46+
47+
Sample configuration
48+
--------------------------------------------
49+
50+
To activate the component add ``bearertokenauth`` to the ``extensions`` section of your configuration file and include the extension in any pipeline of the ``service`` section. For example:
51+
52+
.. code:: yaml
53+
54+
extensions:
55+
bearertokenauth:
56+
token: "somerandomtoken"
57+
filename: "file-containing.token"
58+
bearertokenauth/withscheme:
59+
scheme: "Bearer"
60+
token: "randomtoken"
61+
62+
receivers:
63+
hostmetrics:
64+
scrapers:
65+
memory:
66+
otlp:
67+
protocols:
68+
grpc:
69+
70+
exporters:
71+
otlp/withauth:
72+
endpoint: 0.0.0.0:5000
73+
ca_file: /tmp/certs/ca.pem
74+
auth:
75+
authenticator: bearertokenauth
76+
77+
otlphttp/withauth:
78+
endpoint: http://localhost:9000
79+
auth:
80+
authenticator: bearertokenauth/withscheme
81+
82+
service:
83+
extensions: [bearertokenauth, bearertokenauth/withscheme]
84+
pipelines:
85+
metrics:
86+
receivers: [hostmetrics]
87+
processors: []
88+
exporters: [otlp/withauth, otlphttp/withauth]
89+
90+
.. _bearertokenauth-extension-settings:
91+
92+
Settings
93+
======================
94+
95+
The following table shows the configuration options for the extension:
96+
97+
.. raw:: html
98+
99+
<div class="metrics-standard" category="included" url="https://raw.githubusercontent.com/splunk/collector-config-tools/main/cfg-metadata/extension/bearertokenauth.yaml"></div>
100+
101+
102+
Troubleshooting
103+
======================
104+
105+
.. raw:: html
106+
107+
<div class="include-start" id="troubleshooting-components.rst"></div>
108+
109+
.. include:: /_includes/troubleshooting-components.rst
110+
111+
.. raw:: html
112+
113+
<div class="include-stop" id="troubleshooting-components.rst"></div>
11114

12-
To find information about this component in the meantime, see :new-page:`Authenticator Bearer extension <https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/bearertokenauthextension>` on GitHub.
13115

0 commit comments

Comments
 (0)