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

Commit f64fdb7

Browse files
Draft
1 parent 42d50d0 commit f64fdb7

File tree

2 files changed

+48
-82
lines changed

2 files changed

+48
-82
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: 46 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -7,135 +7,101 @@ 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 ``basicauth`` extension implements both ``configauth.ServerAuthenticator`` and ``configauth.ClientAuthenticator`` to authenticate clients and servers using basic authentication. The authenticator type has to be set to ``basicauth``.
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.
1111

12-
When used to authenticate servers, if the authentication is successful, ``client.Info.Auth`` exposes the following attributes:
12+
The following is required:
1313

14-
* ``username``: The username of the authenticated user.
15-
* ``raw``: Raw base64 encoded credentials.
14+
* You need to set the authenticator type to ``bearertokenauth``.
1615

17-
.. caution:: You can either authenticate servers or clients with the extension. If you configure both options, the extension throws an error. See more in :ref:`basic-auth-extension-settings`.
16+
* You need to enable transport layer security on the exporter.
1817

1918
Get started
2019
======================
2120

2221
Follow these steps to configure and activate the component:
2322

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

2625
- :ref:`otel-install-linux`
2726
- :ref:`otel-install-windows`
2827
- :ref:`otel-install-k8s`
2928

30-
2. Configure the ``basicauth`` extension as described in the next section.
29+
2. Configure the ``bearertokenauth`` extension as described in the next section.
3130
3. Restart the Collector.
3231

33-
Sample configurations
32+
Configuration options
3433
--------------------------------------------
3534

36-
To activate the component add ``basicauth`` to the ``extensions`` section of your configuration file, as shown in the following example:
35+
The following configuration options are available:
3736

38-
.. code:: yaml
37+
* ``filename``. Name of file that contains the authorization token sent in every client call.
3938

40-
extensions:
41-
basicauth/server:
42-
htpasswd:
43-
file: .htpasswd
44-
inline: |
45-
${env:BASIC_AUTH_USERNAME}:${env:BASIC_AUTH_PASSWORD}
46-
47-
basicauth/client:
48-
client_auth:
49-
username: username
50-
password: password
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).
5140

52-
receivers:
53-
otlp:
54-
protocols:
55-
http:
56-
auth:
57-
authenticator: basicauth/server
41+
.. note:: Either ``filename`` or ``token`` are required. If both are specified, then the ``token`` field value is ignored.
5842

59-
processors:
60-
61-
exporters:
62-
otlp:
63-
auth:
64-
authenticator: basicauth/client
43+
Optionally, you can also configure:
6544

66-
To complete the configuration, include the extension in any pipeline of the ``service`` section of your
67-
configuration file. For example:
45+
* ``scheme``. ``Bearer`` by default. Specifies the auth scheme name.
6846

69-
.. code:: yaml
70-
71-
service:
72-
extensions: [basicauth/server, basicauth/client]
73-
pipelines:
74-
traces:
75-
receivers: [otlp]
76-
processors: []
77-
exporters: [otlp]
78-
79-
.. _basic-auth-lightprometheus-settings:
80-
81-
Configuration example: Simple Prometheus receiver
82-
---------------------------------------------------
47+
Sample configuration
48+
--------------------------------------------
8349

84-
The following example illustrates how to configure the ``basicauth`` extension for the :ref:`simple-prometheus-receiver`:
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:
8551

8652
.. code:: yaml
8753
54+
extensions:
55+
bearertokenauth:
56+
token: "somerandomtoken"
57+
filename: "file-containing.token"
58+
bearertokenauth/withscheme:
59+
scheme: "Bearer"
60+
token: "randomtoken"
61+
8862
receivers:
89-
lightprometheus/myjob:
90-
auth:
91-
authenticator: basicauth
92-
collection_interval: 1s
93-
endpoint: "http://localhost:8000/metrics"
63+
hostmetrics:
64+
scrapers:
65+
memory:
66+
otlp:
67+
protocols:
68+
grpc:
9469
9570
exporters:
96-
otlp:
97-
endpoint: "${OTLP_ENDPOINT}"
98-
tls:
99-
insecure: true
71+
otlp/withauth:
72+
endpoint: 0.0.0.0:5000
73+
ca_file: /tmp/certs/ca.pem
74+
auth:
75+
authenticator: bearertokenauth
10076
101-
extensions:
102-
basicauth:
103-
client_auth:
104-
username: foo
105-
password: bar
77+
otlphttp/withauth:
78+
endpoint: http://localhost:9000
79+
auth:
80+
authenticator: bearertokenauth/withscheme
10681
10782
service:
108-
extensions: [ basicauth ]
83+
extensions: [bearertokenauth, bearertokenauth/withscheme]
10984
pipelines:
11085
metrics:
111-
receivers: [ lightprometheus/myjob ]
112-
exporters: [ otlp ]
86+
receivers: [hostmetrics]
87+
processors: []
88+
exporters: [otlp/withauth, otlphttp/withauth]
11389
114-
.. _basic-auth-extension-settings:
90+
.. _bearertokenauth-extension-settings:
11591

11692
Settings
11793
======================
11894

119-
The following table shows the configuration options for the ``basicauth`` extension:
95+
The following table shows the configuration options for the extension:
12096

12197
.. raw:: html
12298

123-
<div class="metrics-standard" category="included" url="https://raw.githubusercontent.com/splunk/collector-config-tools/main/cfg-metadata/extension/basicauth.yaml"></div>
124-
125-
Authenticate servers or clients
126-
--------------------------------------------
127-
128-
You can either authenticate servers or clients with the extension. If you configure both options, the extension throws an error.
129-
130-
* To configure the extension as a server authenticator, set either ``htpasswd.file`` or ``htpasswd.inline``. If you configure both, ``htpasswd.inline`` credentials takes precedence.
99+
<div class="metrics-standard" category="included" url="https://raw.githubusercontent.com/splunk/collector-config-tools/main/cfg-metadata/extension/bearertokenauth.yaml"></div>
131100

132-
* To configure the extension as a client authenticator, set ``client_auth``.
133101

134102
Troubleshooting
135103
======================
136104

137-
138-
139105
.. raw:: html
140106

141107
<div class="include-start" id="troubleshooting-components.rst"></div>

0 commit comments

Comments
 (0)