Skip to content

Commit 0f5b5d8

Browse files
authored
feat: Geneva Uploader : Add config service client (#227)
1 parent e8a88d9 commit 0f5b5d8

File tree

5 files changed

+927
-2
lines changed

5 files changed

+927
-2
lines changed

opentelemetry-exporter-geneva/geneva-uploader/Cargo.toml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,27 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
opentelemetry-proto = {workspace = true, default-features = false, features = ["logs"]}
7+
opentelemetry-proto = {workspace = true, default-features = false, features = ["logs", "gen-tonic-messages"]}
8+
base64 = "0.22"
9+
serde = { version = "1.0", features = ["derive"] }
10+
serde_json = { version = "1.0", features = ["raw_value"] }
11+
uuid = { version = "1.0", features = ["v4"] }
12+
# TODO - support both native-tls and rustls
13+
reqwest = { version = "0.12", features = ["native-tls", "native-tls-alpn"]}
14+
native-tls = "0.2"
15+
thiserror = "2.0"
16+
chrono = "0.4"
17+
18+
[features]
19+
self_signed_certs = [] # Empty by default for security
20+
default = ["self_signed_certs"] # TODO - remove this feature before release
21+
22+
[dev-dependencies]
23+
tokio = { version = "1", features = ["full"] }
24+
rcgen = "0.13"
25+
openssl = { version = "0.10", features = ["vendored"] }
26+
tempfile = "3.5"
27+
wiremock = "0.6"
828

929
[lints]
10-
workspace = true
30+
workspace = true
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
### GenevaConfigClient Flow (Certificate-Based Authentication)
2+
3+
The diagram below illustrates how the `GenevaConfigClient` is initialized with a client certificate (in PKCS#12 format) and then used to fetch ingestion information from the Geneva Config Service using mutual TLS (mTLS). It includes the flow for loading the certificate, handling cached tokens, making authenticated requests, and parsing the response (including primary diagnostic monikers).
4+
5+
```mermaid
6+
sequenceDiagram
7+
participant App as User
8+
participant Client as GenevaConfigClient
9+
participant TLS as native_tls
10+
participant GCS as Geneva Config Service
11+
12+
App->>Client: new(GenevaConfigClientConfig)
13+
Client->>TLS: Load PKCS#12 cert
14+
TLS-->>Client: native_tls::TlsConnector
15+
Client->>Client: Build reqwest::Client with mTLS
16+
17+
App->>Client: get_ingestion_info()
18+
19+
alt Token in cache and not expired
20+
Client->>App: Return cached (IngestionGatewayInfo, MonikerInfo)
21+
else Cache miss or token expired
22+
Client->>Client: Build HTTP GET URL
23+
Client->>GCS: Send HTTPS request with mTLS\n+ Query Params & Headers
24+
GCS-->>Client: JSON response (200 OK or error)
25+
26+
alt Response contains valid moniker
27+
Client->>Client: Parse IngestionGatewayInfo and MonikerInfo
28+
Client->>Client: Cache new token + expiry
29+
Client->>App: Return new (IngestionGatewayInfo, MonikerInfo)
30+
else No valid moniker
31+
Client->>App: Error (MonikerNotFound)
32+
end
33+
end

0 commit comments

Comments
 (0)