Skip to content

Commit 25b5337

Browse files
wtobis-splunkhetangmodi-crestsrv-rr-github-token
authored
chore: sync main into develop and prepare release 8.0.0 (#454)
Co-authored-by: Hetang Modi <62056057+hetangmodi-crest@users.noreply.github.com> Co-authored-by: srv-rr-github-token <94607705+srv-rr-github-token@users.noreply.github.com>
1 parent fc26f47 commit 25b5337

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

docs/release_8_0_0.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Release 8.0.0
2+
3+
## Breaking changes
4+
5+
### Python 3.7 and 3.8 are no longer supported
6+
7+
As of version 8.0.0, Python 3.7 and 3.8 are no longer supported.
8+
The minimum required Python version is now **3.9**.
9+
10+
If your add-on runs on Python 3.7 or 3.8, you must upgrade your environment
11+
before upgrading solnlib to 8.0.0.
12+
13+
### New required dependencies
14+
15+
The `observability` module introduces the following new dependencies:
16+
17+
* `opentelemetry-api >=1.39.1,<2`
18+
* `opentelemetry-sdk >=1.39.1,<2`
19+
* `opentelemetry-exporter-otlp-proto-grpc >=1.39.1,<2`
20+
* `grpcio >=1.74.0`
21+
22+
These are installed automatically when installing solnlib via pip.
23+
24+
## New features
25+
26+
### ObservabilityService
27+
28+
A new `solnlib.observability` module has been added. It provides OpenTelemetry
29+
metric instrumentation for Splunk modular inputs, with automatic integration
30+
with the Splunk Spotlight collector.
31+
32+
The module exposes two public components:
33+
34+
* `ObservabilityService` — initializes a `MeterProvider` with two built-in
35+
event counters and attempts to connect to the local Spotlight OTLP collector.
36+
Falls back silently when the collector is not available, so observability
37+
failures never break the add-on.
38+
* `LoggerMetricExporter` — an OpenTelemetry `MetricExporter` that writes
39+
data points to a Python logger. Useful for local development and debugging.
40+
41+
**Built-in counters:**
42+
43+
| Attribute | Metric name | Unit |
44+
|-------------------------|-------------------------------|-------|
45+
| `event_count_counter` | `splunk.addon.events` | `1` |
46+
| `event_bytes_counter` | `splunk.addon.events.bytes` | `By` |
47+
48+
**Example usage:**
49+
50+
```python
51+
import logging
52+
from solnlib.observability import ObservabilityService, ATTR_MODINPUT_NAME
53+
54+
logger = logging.getLogger(__name__)
55+
56+
obs = ObservabilityService(
57+
modinput_type="my-input",
58+
logger=logger,
59+
ta_name="my_ta",
60+
ta_version="1.0.0",
61+
)
62+
63+
# In your event collection loop:
64+
if obs.event_count_counter:
65+
obs.event_count_counter.add(len(events), {ATTR_MODINPUT_NAME: stanza_name})
66+
if obs.event_bytes_counter:
67+
obs.event_bytes_counter.add(total_bytes, {ATTR_MODINPUT_NAME: stanza_name})
68+
```
69+
70+
When `ta_name` and `ta_version` are not provided, they are read automatically
71+
from `app.conf` via `get_conf_stanzas`. Pass them explicitly when running
72+
outside a full Splunk environment.
73+
74+
Additional instruments can be registered using `ObservabilityService.register_instrument`.
75+
76+
For full API reference see [observability.py](observability.md).

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ nav:
3232
- Home: index.md
3333
- Release 6.0.0: release_6_0_0.md
3434
- Release 7.0.0: release_7_0_0.md
35+
- Release 8.0.0: release_8_0_0.md
3536
- References:
3637
- modular_input:
3738
- "checkpointer.py": modular_input/checkpointer.md

0 commit comments

Comments
 (0)