Liking cljdoc? Tell your friends :D

hive-compose.promote.otel

Pure: the built-in otel capability and the OTLP environment a consumer is given so its telemetry is correlated by run id (and test id).

Services integrate through the OpenTelemetry protocol only: the standard OTEL_* environment variables every OTel SDK and Beyla read. No hive code ships into a service.

OTEL_RESOURCE_ATTRIBUTES is k1=v1,k2=v2 as the OTel SDK environment spec prescribes: keys are W3C baggage tokens and are written as they are (an SDK never decodes a key), values are percent-encoded, so a value holding , = % or a space survives the trip.

The otel instance joins every consumer's view network hive-<run>-<consumer> under its service name otel (hc-5 :wiring/attach), so the container-side endpoint is http://otel:4317; a host process reaches the published port on localhost.

Pure: the built-in otel capability and the OTLP environment a consumer is
given so its telemetry is correlated by run id (and test id).

Services integrate through the OpenTelemetry protocol only: the standard
OTEL_* environment variables every OTel SDK and Beyla read. No hive code
ships into a service.

OTEL_RESOURCE_ATTRIBUTES is `k1=v1,k2=v2` as the OTel SDK environment spec
prescribes: keys are W3C baggage tokens and are written as they are (an SDK
never decodes a key), values are percent-encoded, so a value holding `,`
`=` `%` or a space survives the trip.

The otel instance joins every consumer's view network `hive-<run>-<consumer>`
under its service name `otel` (hc-5 :wiring/attach), so the container-side
endpoint is `http://otel:4317`; a host process reaches the published port
on localhost.
raw docstring

beyla-versionclj

The grafana/beyla tag of the fragment's optional beyla service.

The grafana/beyla tag of the fragment's optional `beyla` service.
sourceraw docstring

compose-resourceclj

Classpath resource of the compose fragment running the otel provider.

Classpath resource of the compose fragment running the otel provider.
sourceraw docstring

correlation-attribute?clj

(correlation-attribute? k)

True for the resource attributes hive-compose correlates a run by, the hive.* keys (hive.run.id, hive.test.id): an injected value always wins for them, a run's telemetry must carry its own run id.

True for the resource attributes hive-compose correlates a run by, the
`hive.*` keys (hive.run.id, hive.test.id): an injected value always wins
for them, a run's telemetry must carry its own run id.
sourceraw docstring

endpointclj

(endpoint side protocol)

The OTLP endpoint of the otel instance for protocol (:grpc or :http) seen from side: :container (the consumer's view network, alias otel) or :host (the published port on localhost).

The OTLP endpoint of the otel instance for `protocol` (:grpc or :http) seen
from `side`: :container (the consumer's view network, alias `otel`) or
:host (the published port on localhost).
sourceraw docstring

exporter-pairclj

Endpoint and protocol are one unit: an endpoint means nothing without the protocol it speaks.

Endpoint and protocol are one unit: an endpoint means nothing without the
protocol it speaks.
sourceraw docstring

lgtm-versionclj

The grafana/otel-lgtm tag resources/hive-compose/otel/compose.yml pins.

The grafana/otel-lgtm tag resources/hive-compose/otel/compose.yml pins.
sourceraw docstring

merge-resource-attributesclj

(merge-resource-attributes base over)

OTEL_RESOURCE_ATTRIBUTES of base with over merged in per key (both strings, nil for none): over wins for every key it sets, a key keeps the position it first had, new keys follow in over's order, a later duplicate wins. Entries are moved verbatim, never re-encoded, so a user's attributes survive byte for byte and nothing throws. Malformed entries (no =, empty key) are dropped, as SDKs drop them.

The hc-5 layering forces the correlation keys with it: (merge-resource-attributes consumer-ra (render-resource-attributes (select-keys injected-attrs (filter correlation-attribute? ...)))).

OTEL_RESOURCE_ATTRIBUTES of `base` with `over` merged in per key (both
strings, nil for none): `over` wins for every key it sets, a key keeps
the position it first had, new keys follow in `over`'s order, a later
duplicate wins. Entries are moved verbatim, never re-encoded, so a user's
attributes survive byte for byte and nothing throws. Malformed entries
(no `=`, empty key) are dropped, as SDKs drop them.

The hc-5 layering forces the correlation keys with it:
(merge-resource-attributes consumer-ra (render-resource-attributes
  (select-keys injected-attrs (filter correlation-attribute? ...)))).
sourceraw docstring

otlp-envclj

(otlp-env {:keys [run-id service protocol side] :as opts})

The OTLP environment variables for one consumer.

opts: :run-id and :service (OTEL_SERVICE_NAME) required, optional :test-id, :protocol (:grpc, default, or :http), :side (:container, default, or :host) or an explicit :endpoint, and :extra-attrs {key value}. Throws ex-info on a blank run id or service or an unknown protocol.

The OTLP environment variables for one consumer.

`opts`: :run-id and :service (OTEL_SERVICE_NAME) required, optional
:test-id, :protocol (:grpc, default, or :http), :side (:container,
default, or :host) or an explicit :endpoint, and :extra-attrs {key value}.
Throws ex-info on a blank run id or service or an unknown protocol.
sourceraw docstring

otlp-pair-broken?clj

(otlp-pair-broken? env)

True when env names exactly one of endpoint and protocol.

True when `env` names exactly one of endpoint and protocol.
sourceraw docstring

otlp-pair-mergeclj

(otlp-pair-merge base over)

over merged onto base per key, with endpoint and protocol as one unit: when over names either, both of base's are dropped first, so an endpoint never ends up beside a protocol it does not speak. The env layering itself (injected < consumer < forced) is hc-5 wiring's; this is the rule it applies at each layer.

`over` merged onto `base` per key, with endpoint and protocol as one unit:
when `over` names either, both of `base`'s are dropped first, so an
endpoint never ends up beside a protocol it does not speak. The env
layering itself (injected < consumer < forced) is hc-5 wiring's; this is
the rule it applies at each layer.
sourceraw docstring

parse-resource-attributesclj

(parse-resource-attributes s)

{key value} of an OTEL_RESOURCE_ATTRIBUTES string; inverse of render-resource-attributes. Entries are trimmed; an entry without = or with an empty key is dropped (as OTel SDKs discard it); values are percent-decoded; a later duplicate key wins.

{key value} of an OTEL_RESOURCE_ATTRIBUTES string; inverse of
`render-resource-attributes`. Entries are trimmed; an entry without `=`
or with an empty key is dropped (as OTel SDKs discard it); values are
percent-decoded; a later duplicate key wins.
sourceraw docstring

percent-decodeclj

(percent-decode s)

Inverse of percent-encode. Runs of %XX escapes are decoded as UTF-8; every other character (astral ones included) is copied as it is; a % not followed by two hex digits stays literal; + is a plus.

Inverse of `percent-encode`. Runs of `%XX` escapes are decoded as UTF-8;
every other character (astral ones included) is copied as it is; a `%`
not followed by two hex digits stays literal; `+` is a plus.
sourceraw docstring

percent-encodeclj

(percent-encode s)

s with every UTF-8 byte outside the RFC 3986 unreserved set as %XX (upper-case hex): a superset of what W3C baggage requires of a value, and deterministic. , = % and whitespace never survive raw.

`s` with every UTF-8 byte outside the RFC 3986 unreserved set as `%XX`
(upper-case hex): a superset of what W3C baggage requires of a value, and
deterministic. `,` `=` `%` and whitespace never survive raw.
sourceraw docstring

portsclj

Container ports of the otel-lgtm image, by role.

Container ports of the otel-lgtm image, by role.
sourceraw docstring

protocolsclj

OTEL_EXPORTER_OTLP_PROTOCOL by protocol keyword.

OTEL_EXPORTER_OTLP_PROTOCOL by protocol keyword.
sourceraw docstring

providerclj

The built-in otel capability: grafana/otel-lgtm as service otel.

The built-in otel capability: grafana/otel-lgtm as service `otel`.
sourceraw docstring

render-resource-attributesclj

(render-resource-attributes attrs)

OTEL_RESOURCE_ATTRIBUTES of attrs {key value}: keys raw, values percent-encoded, hive.run.id / service.name / hive.test.id first and the rest in key order. Throws ex-info naming the keys that are not valid-key?.

OTEL_RESOURCE_ATTRIBUTES of `attrs` {key value}: keys raw, values
percent-encoded, hive.run.id / service.name / hive.test.id first and the
rest in key order. Throws ex-info naming the keys that are not
`valid-key?`.
sourceraw docstring

resource-attributesclj

(resource-attributes {:keys [run-id service test-id extra-attrs]})

{key value}: hive.run.id, service.name, hive.test.id (when given) and extra-attrs; an extra key never overrides those three. Throws ex-info when two extra keys name the same attribute once normalised.

{key value}: hive.run.id, service.name, hive.test.id (when given) and
`extra-attrs`; an extra key never overrides those three. Throws ex-info
when two extra keys name the same attribute once normalised.
sourceraw docstring

serviceclj

The compose service answering the otel capability, and the alias it joins consumer view networks under.

The compose service answering the otel capability, and the alias it joins
consumer view networks under.
sourceraw docstring

valid-key?clj

(valid-key? k)

True when k can be an OTEL_RESOURCE_ATTRIBUTES key: a non-empty W3C baggage token (RFC 7230 tchar) without %, which a parser would read as an escape.

True when `k` can be an OTEL_RESOURCE_ATTRIBUTES key: a non-empty W3C
baggage token (RFC 7230 tchar) without `%`, which a parser would read as
an escape.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close