jps-observability-utils 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jps_observability_utils-0.1.0/LICENSE +14 -0
- jps_observability_utils-0.1.0/PKG-INFO +222 -0
- jps_observability_utils-0.1.0/README.md +182 -0
- jps_observability_utils-0.1.0/pyproject.toml +210 -0
- jps_observability_utils-0.1.0/setup.cfg +4 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/__init__.py +3 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/cli.py +93 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/constants.py +91 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/matchers/__init__.py +1 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/matchers/common.py +76 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/matchers/node_repo.py +114 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/matchers/python_repo.py +122 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/models.py +108 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/report_writer.py +156 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/scanner.py +121 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/trace_matrix_writer.py +36 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/utils/__init__.py +1 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/utils/file_utils.py +79 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/utils/id_utils.py +31 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils/utils/text_utils.py +34 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils.egg-info/PKG-INFO +222 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils.egg-info/SOURCES.txt +29 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils.egg-info/dependency_links.txt +1 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils.egg-info/entry_points.txt +2 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils.egg-info/requires.txt +24 -0
- jps_observability_utils-0.1.0/src/jps_observability_utils.egg-info/top_level.txt +1 -0
- jps_observability_utils-0.1.0/tests/test_cli.py +53 -0
- jps_observability_utils-0.1.0/tests/test_node_audit.py +37 -0
- jps_observability_utils-0.1.0/tests/test_python_audit.py +37 -0
- jps_observability_utils-0.1.0/tests/test_report_writer.py +24 -0
- jps_observability_utils-0.1.0/tests/test_trace_matrix_writer.py +22 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jaideep Sundaram
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jps-observability-utils
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Utilities for auditing Python and Node.js repositories for observability-related instrumentation and integrations.
|
|
5
|
+
Author-email: Jaideep Sundaram <jai.python3@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/jai-python3/jps-observability-utils
|
|
8
|
+
Project-URL: Repository, https://github.com/jai-python3/jps-observability-utils
|
|
9
|
+
Project-URL: Issues, https://github.com/jai-python3/jps-observability-utils/issues
|
|
10
|
+
Keywords: cookiecutter,bootstrap,project-generator,automation
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: typer>=0.12.3
|
|
18
|
+
Provides-Extra: test
|
|
19
|
+
Requires-Dist: pytest>=8.0.0; extra == "test"
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: flake8>=7.0.0; extra == "dev"
|
|
22
|
+
Requires-Dist: black>=24.0.0; extra == "dev"
|
|
23
|
+
Requires-Dist: build>=1.2.1; extra == "dev"
|
|
24
|
+
Requires-Dist: twine>=5.0.0; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
|
|
27
|
+
Requires-Dist: isort>=5.13.0; extra == "dev"
|
|
28
|
+
Requires-Dist: codecov>=2.1.13; extra == "dev"
|
|
29
|
+
Requires-Dist: autoflake>=2.3.1; extra == "dev"
|
|
30
|
+
Requires-Dist: pre-commit>=3.8.0; extra == "dev"
|
|
31
|
+
Requires-Dist: bandit>=1.7.9; extra == "dev"
|
|
32
|
+
Requires-Dist: vulture>=2.11; extra == "dev"
|
|
33
|
+
Requires-Dist: flynt>=1.0.1; extra == "dev"
|
|
34
|
+
Requires-Dist: pydocstyle>=6.3.0; extra == "dev"
|
|
35
|
+
Requires-Dist: darglint>=1.8.1; extra == "dev"
|
|
36
|
+
Requires-Dist: mypy>=1.12.1; extra == "dev"
|
|
37
|
+
Requires-Dist: bump-my-version>=1.0.1; extra == "dev"
|
|
38
|
+
Requires-Dist: git-changelog>=2.7.0; extra == "dev"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# jps-observability-utils
|
|
42
|
+
|
|
43
|
+
Utilities for auditing Python and Node.js repositories for evidence of observability-related instrumentation, telemetry configuration, monitoring components, and integrations with common observability platforms.
|
|
44
|
+
|
|
45
|
+
## Overview
|
|
46
|
+
|
|
47
|
+
`jps-observability-utils` is a Python CLI package that performs static repository scans and generates observability audit reports.
|
|
48
|
+
|
|
49
|
+
The initial version is designed for legacy codebase assessment, onboarding, and engineering due diligence. It helps identify evidence of technologies such as OpenTelemetry, Prometheus, Datadog, New Relic, Sentry, Elastic APM, collector configuration, metrics endpoints, and structured logging patterns.
|
|
50
|
+
|
|
51
|
+
The package is intentionally evidence-based. It does not claim runtime certainty. It reports what the repository contents suggest.
|
|
52
|
+
|
|
53
|
+
## Initial Scope
|
|
54
|
+
|
|
55
|
+
The initial release includes two Typer-based CLI commands:
|
|
56
|
+
|
|
57
|
+
- `audit-python` — scan a Python repository
|
|
58
|
+
- `audit-node` — scan a Node.js repository
|
|
59
|
+
|
|
60
|
+
Each command generates a human-readable Markdown report and a machine-readable JSON report.
|
|
61
|
+
|
|
62
|
+
## What the Tool Detects
|
|
63
|
+
|
|
64
|
+
The scanners look for evidence of observability-related instrumentation and integrations, including:
|
|
65
|
+
|
|
66
|
+
- telemetry instrumentation libraries
|
|
67
|
+
- OpenTelemetry SDKs, exporters, and environment variables
|
|
68
|
+
- Prometheus client libraries and `/metrics` patterns
|
|
69
|
+
- vendor-specific observability platforms such as Datadog, New Relic, Sentry, and Elastic APM
|
|
70
|
+
- collector / exporter configuration
|
|
71
|
+
- deployment and environment configuration relevant to telemetry
|
|
72
|
+
- structured logging patterns relevant to observability
|
|
73
|
+
|
|
74
|
+
## What the Tool Does Not Do
|
|
75
|
+
|
|
76
|
+
This project does not, in its initial version:
|
|
77
|
+
|
|
78
|
+
- execute code
|
|
79
|
+
- validate runtime telemetry emission
|
|
80
|
+
- prove that observability is functioning in production
|
|
81
|
+
- modify the target repository
|
|
82
|
+
- auto-remediate missing instrumentation
|
|
83
|
+
|
|
84
|
+
## Why This Tool Exists
|
|
85
|
+
|
|
86
|
+
Legacy repositories often contain partial, inconsistent, or undocumented observability setups. Engineers reviewing a codebase typically need fast answers to questions such as:
|
|
87
|
+
|
|
88
|
+
- Does this project appear to use OpenTelemetry?
|
|
89
|
+
- Is Prometheus instrumentation present?
|
|
90
|
+
- Is there evidence of Datadog or New Relic integration?
|
|
91
|
+
- Are telemetry environment variables configured?
|
|
92
|
+
- Is there collector or OTLP configuration in the repo?
|
|
93
|
+
- Are there signs of structured logging or metrics endpoints?
|
|
94
|
+
|
|
95
|
+
This tool is intended to reduce manual grep-heavy investigation.
|
|
96
|
+
|
|
97
|
+
## Proposed CLI Usage
|
|
98
|
+
|
|
99
|
+
Examples:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
jps-observability-utils audit-python /path/to/python-repo --format both --output-dir ./reports
|
|
103
|
+
jps-observability-utils audit-node /path/to/node-repo --format both --output-dir ./reports
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Possible options may include:
|
|
107
|
+
|
|
108
|
+
- `--output-dir`
|
|
109
|
+
- `--format [md|json|both]`
|
|
110
|
+
- `--ignore PATTERN`
|
|
111
|
+
- `--verbose`
|
|
112
|
+
|
|
113
|
+
## Expected Report Content
|
|
114
|
+
|
|
115
|
+
Each report should include:
|
|
116
|
+
|
|
117
|
+
- scan metadata
|
|
118
|
+
- repository path
|
|
119
|
+
- number of files scanned
|
|
120
|
+
- summary of detected technologies
|
|
121
|
+
- findings grouped by category
|
|
122
|
+
- confidence level for each finding
|
|
123
|
+
- file paths and evidence locations
|
|
124
|
+
- caveats explaining that the audit is static and heuristic-based
|
|
125
|
+
|
|
126
|
+
## Confidence Model
|
|
127
|
+
|
|
128
|
+
A simple confidence model is recommended:
|
|
129
|
+
|
|
130
|
+
- **High** — strong evidence such as dependency + initialization code or env vars + exporter configuration
|
|
131
|
+
- **Medium** — partial but meaningful evidence such as dependency presence without clear initialization
|
|
132
|
+
- **Low** — weak or indirect evidence only
|
|
133
|
+
|
|
134
|
+
## Suggested MVP Detection Targets
|
|
135
|
+
|
|
136
|
+
### Python repositories
|
|
137
|
+
|
|
138
|
+
- OpenTelemetry
|
|
139
|
+
- Prometheus
|
|
140
|
+
- Datadog
|
|
141
|
+
- New Relic
|
|
142
|
+
- Sentry
|
|
143
|
+
- Elastic APM
|
|
144
|
+
- collector / OTLP config
|
|
145
|
+
- structured logging indicators
|
|
146
|
+
|
|
147
|
+
### Node.js repositories
|
|
148
|
+
|
|
149
|
+
- OpenTelemetry
|
|
150
|
+
- Prometheus
|
|
151
|
+
- Datadog
|
|
152
|
+
- New Relic
|
|
153
|
+
- Sentry
|
|
154
|
+
- Elastic APM
|
|
155
|
+
- collector / OTLP config
|
|
156
|
+
- structured logging indicators
|
|
157
|
+
|
|
158
|
+
## Recommended Package Structure
|
|
159
|
+
|
|
160
|
+
```text
|
|
161
|
+
src/jps_observability_utils/
|
|
162
|
+
├── cli.py
|
|
163
|
+
├── constants.py
|
|
164
|
+
├── models.py
|
|
165
|
+
├── scanner.py
|
|
166
|
+
├── report_writer.py
|
|
167
|
+
├── matchers/
|
|
168
|
+
│ ├── common.py
|
|
169
|
+
│ ├── python_repo.py
|
|
170
|
+
│ └── node_repo.py
|
|
171
|
+
└── utils/
|
|
172
|
+
├── file_utils.py
|
|
173
|
+
└── text_utils.py
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Design Principles
|
|
177
|
+
|
|
178
|
+
- static evidence detection, not runtime proof
|
|
179
|
+
- clear and conservative language
|
|
180
|
+
- modular detection rules
|
|
181
|
+
- stable JSON output
|
|
182
|
+
- easy extensibility for additional technologies and languages
|
|
183
|
+
|
|
184
|
+
## Example GitHub Project Description
|
|
185
|
+
|
|
186
|
+
Utilities for auditing Python and Node.js repositories for observability-related instrumentation and integrations.
|
|
187
|
+
|
|
188
|
+
## Development Notes
|
|
189
|
+
|
|
190
|
+
Recommended implementation choices:
|
|
191
|
+
|
|
192
|
+
- Python 3.11+
|
|
193
|
+
- Typer for CLI
|
|
194
|
+
- pathlib for filesystem traversal
|
|
195
|
+
- dataclasses or Pydantic for report models
|
|
196
|
+
- pytest for testing
|
|
197
|
+
|
|
198
|
+
## Testing Strategy
|
|
199
|
+
|
|
200
|
+
The test suite should include small fixture repositories representing:
|
|
201
|
+
|
|
202
|
+
- positive OpenTelemetry detection
|
|
203
|
+
- Prometheus-only detection
|
|
204
|
+
- vendor-specific APM detection
|
|
205
|
+
- no observability evidence
|
|
206
|
+
- mixed evidence across code and deployment files
|
|
207
|
+
|
|
208
|
+
## Future Enhancements
|
|
209
|
+
|
|
210
|
+
Potential future additions:
|
|
211
|
+
|
|
212
|
+
- unified `audit-repo` command with language auto-detection
|
|
213
|
+
- HTML reports
|
|
214
|
+
- SARIF output
|
|
215
|
+
- maturity scoring
|
|
216
|
+
- custom rule packs
|
|
217
|
+
- support for additional languages
|
|
218
|
+
|
|
219
|
+
## Status
|
|
220
|
+
|
|
221
|
+
This repository is intended to start with two focused audit utilities and expand over time as the detection catalog matures.
|
|
222
|
+
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# jps-observability-utils
|
|
2
|
+
|
|
3
|
+
Utilities for auditing Python and Node.js repositories for evidence of observability-related instrumentation, telemetry configuration, monitoring components, and integrations with common observability platforms.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`jps-observability-utils` is a Python CLI package that performs static repository scans and generates observability audit reports.
|
|
8
|
+
|
|
9
|
+
The initial version is designed for legacy codebase assessment, onboarding, and engineering due diligence. It helps identify evidence of technologies such as OpenTelemetry, Prometheus, Datadog, New Relic, Sentry, Elastic APM, collector configuration, metrics endpoints, and structured logging patterns.
|
|
10
|
+
|
|
11
|
+
The package is intentionally evidence-based. It does not claim runtime certainty. It reports what the repository contents suggest.
|
|
12
|
+
|
|
13
|
+
## Initial Scope
|
|
14
|
+
|
|
15
|
+
The initial release includes two Typer-based CLI commands:
|
|
16
|
+
|
|
17
|
+
- `audit-python` — scan a Python repository
|
|
18
|
+
- `audit-node` — scan a Node.js repository
|
|
19
|
+
|
|
20
|
+
Each command generates a human-readable Markdown report and a machine-readable JSON report.
|
|
21
|
+
|
|
22
|
+
## What the Tool Detects
|
|
23
|
+
|
|
24
|
+
The scanners look for evidence of observability-related instrumentation and integrations, including:
|
|
25
|
+
|
|
26
|
+
- telemetry instrumentation libraries
|
|
27
|
+
- OpenTelemetry SDKs, exporters, and environment variables
|
|
28
|
+
- Prometheus client libraries and `/metrics` patterns
|
|
29
|
+
- vendor-specific observability platforms such as Datadog, New Relic, Sentry, and Elastic APM
|
|
30
|
+
- collector / exporter configuration
|
|
31
|
+
- deployment and environment configuration relevant to telemetry
|
|
32
|
+
- structured logging patterns relevant to observability
|
|
33
|
+
|
|
34
|
+
## What the Tool Does Not Do
|
|
35
|
+
|
|
36
|
+
This project does not, in its initial version:
|
|
37
|
+
|
|
38
|
+
- execute code
|
|
39
|
+
- validate runtime telemetry emission
|
|
40
|
+
- prove that observability is functioning in production
|
|
41
|
+
- modify the target repository
|
|
42
|
+
- auto-remediate missing instrumentation
|
|
43
|
+
|
|
44
|
+
## Why This Tool Exists
|
|
45
|
+
|
|
46
|
+
Legacy repositories often contain partial, inconsistent, or undocumented observability setups. Engineers reviewing a codebase typically need fast answers to questions such as:
|
|
47
|
+
|
|
48
|
+
- Does this project appear to use OpenTelemetry?
|
|
49
|
+
- Is Prometheus instrumentation present?
|
|
50
|
+
- Is there evidence of Datadog or New Relic integration?
|
|
51
|
+
- Are telemetry environment variables configured?
|
|
52
|
+
- Is there collector or OTLP configuration in the repo?
|
|
53
|
+
- Are there signs of structured logging or metrics endpoints?
|
|
54
|
+
|
|
55
|
+
This tool is intended to reduce manual grep-heavy investigation.
|
|
56
|
+
|
|
57
|
+
## Proposed CLI Usage
|
|
58
|
+
|
|
59
|
+
Examples:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
jps-observability-utils audit-python /path/to/python-repo --format both --output-dir ./reports
|
|
63
|
+
jps-observability-utils audit-node /path/to/node-repo --format both --output-dir ./reports
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Possible options may include:
|
|
67
|
+
|
|
68
|
+
- `--output-dir`
|
|
69
|
+
- `--format [md|json|both]`
|
|
70
|
+
- `--ignore PATTERN`
|
|
71
|
+
- `--verbose`
|
|
72
|
+
|
|
73
|
+
## Expected Report Content
|
|
74
|
+
|
|
75
|
+
Each report should include:
|
|
76
|
+
|
|
77
|
+
- scan metadata
|
|
78
|
+
- repository path
|
|
79
|
+
- number of files scanned
|
|
80
|
+
- summary of detected technologies
|
|
81
|
+
- findings grouped by category
|
|
82
|
+
- confidence level for each finding
|
|
83
|
+
- file paths and evidence locations
|
|
84
|
+
- caveats explaining that the audit is static and heuristic-based
|
|
85
|
+
|
|
86
|
+
## Confidence Model
|
|
87
|
+
|
|
88
|
+
A simple confidence model is recommended:
|
|
89
|
+
|
|
90
|
+
- **High** — strong evidence such as dependency + initialization code or env vars + exporter configuration
|
|
91
|
+
- **Medium** — partial but meaningful evidence such as dependency presence without clear initialization
|
|
92
|
+
- **Low** — weak or indirect evidence only
|
|
93
|
+
|
|
94
|
+
## Suggested MVP Detection Targets
|
|
95
|
+
|
|
96
|
+
### Python repositories
|
|
97
|
+
|
|
98
|
+
- OpenTelemetry
|
|
99
|
+
- Prometheus
|
|
100
|
+
- Datadog
|
|
101
|
+
- New Relic
|
|
102
|
+
- Sentry
|
|
103
|
+
- Elastic APM
|
|
104
|
+
- collector / OTLP config
|
|
105
|
+
- structured logging indicators
|
|
106
|
+
|
|
107
|
+
### Node.js repositories
|
|
108
|
+
|
|
109
|
+
- OpenTelemetry
|
|
110
|
+
- Prometheus
|
|
111
|
+
- Datadog
|
|
112
|
+
- New Relic
|
|
113
|
+
- Sentry
|
|
114
|
+
- Elastic APM
|
|
115
|
+
- collector / OTLP config
|
|
116
|
+
- structured logging indicators
|
|
117
|
+
|
|
118
|
+
## Recommended Package Structure
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
src/jps_observability_utils/
|
|
122
|
+
├── cli.py
|
|
123
|
+
├── constants.py
|
|
124
|
+
├── models.py
|
|
125
|
+
├── scanner.py
|
|
126
|
+
├── report_writer.py
|
|
127
|
+
├── matchers/
|
|
128
|
+
│ ├── common.py
|
|
129
|
+
│ ├── python_repo.py
|
|
130
|
+
│ └── node_repo.py
|
|
131
|
+
└── utils/
|
|
132
|
+
├── file_utils.py
|
|
133
|
+
└── text_utils.py
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Design Principles
|
|
137
|
+
|
|
138
|
+
- static evidence detection, not runtime proof
|
|
139
|
+
- clear and conservative language
|
|
140
|
+
- modular detection rules
|
|
141
|
+
- stable JSON output
|
|
142
|
+
- easy extensibility for additional technologies and languages
|
|
143
|
+
|
|
144
|
+
## Example GitHub Project Description
|
|
145
|
+
|
|
146
|
+
Utilities for auditing Python and Node.js repositories for observability-related instrumentation and integrations.
|
|
147
|
+
|
|
148
|
+
## Development Notes
|
|
149
|
+
|
|
150
|
+
Recommended implementation choices:
|
|
151
|
+
|
|
152
|
+
- Python 3.11+
|
|
153
|
+
- Typer for CLI
|
|
154
|
+
- pathlib for filesystem traversal
|
|
155
|
+
- dataclasses or Pydantic for report models
|
|
156
|
+
- pytest for testing
|
|
157
|
+
|
|
158
|
+
## Testing Strategy
|
|
159
|
+
|
|
160
|
+
The test suite should include small fixture repositories representing:
|
|
161
|
+
|
|
162
|
+
- positive OpenTelemetry detection
|
|
163
|
+
- Prometheus-only detection
|
|
164
|
+
- vendor-specific APM detection
|
|
165
|
+
- no observability evidence
|
|
166
|
+
- mixed evidence across code and deployment files
|
|
167
|
+
|
|
168
|
+
## Future Enhancements
|
|
169
|
+
|
|
170
|
+
Potential future additions:
|
|
171
|
+
|
|
172
|
+
- unified `audit-repo` command with language auto-detection
|
|
173
|
+
- HTML reports
|
|
174
|
+
- SARIF output
|
|
175
|
+
- maturity scoring
|
|
176
|
+
- custom rule packs
|
|
177
|
+
- support for additional languages
|
|
178
|
+
|
|
179
|
+
## Status
|
|
180
|
+
|
|
181
|
+
This repository is intended to start with two focused audit utilities and expand over time as the detection catalog matures.
|
|
182
|
+
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel", "build"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "jps-observability-utils"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Utilities for auditing Python and Node.js repositories for observability-related instrumentation and integrations."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = [{ name = "Jaideep Sundaram", email = "jai.python3@gmail.com" }]
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
keywords = ["cookiecutter", "bootstrap", "project-generator", "automation"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Operating System :: OS Independent"
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
dependencies = [
|
|
21
|
+
"typer>=0.12.3"
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Homepage = "https://github.com/jai-python3/jps-observability-utils"
|
|
26
|
+
Repository = "https://github.com/jai-python3/jps-observability-utils"
|
|
27
|
+
Issues = "https://github.com/jai-python3/jps-observability-utils/issues"
|
|
28
|
+
|
|
29
|
+
[project.scripts]
|
|
30
|
+
jps-observability-utils = "jps_observability_utils.cli:app"
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
test = ["pytest>=8.0.0"]
|
|
34
|
+
dev = [
|
|
35
|
+
"flake8>=7.0.0",
|
|
36
|
+
"black>=24.0.0",
|
|
37
|
+
"build>=1.2.1",
|
|
38
|
+
"twine>=5.0.0",
|
|
39
|
+
"pytest>=8.0.0",
|
|
40
|
+
"pytest-cov>=5.0.0",
|
|
41
|
+
"isort>=5.13.0",
|
|
42
|
+
"codecov>=2.1.13",
|
|
43
|
+
"autoflake>=2.3.1",
|
|
44
|
+
"pre-commit>=3.8.0",
|
|
45
|
+
"bandit>=1.7.9",
|
|
46
|
+
"vulture>=2.11",
|
|
47
|
+
"flynt>=1.0.1",
|
|
48
|
+
"pydocstyle>=6.3.0",
|
|
49
|
+
"darglint>=1.8.1",
|
|
50
|
+
"mypy>=1.12.1",
|
|
51
|
+
"bump-my-version>=1.0.1",
|
|
52
|
+
"git-changelog>=2.7.0",
|
|
53
|
+
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
[tool.setuptools]
|
|
57
|
+
include-package-data = true
|
|
58
|
+
|
|
59
|
+
[tool.setuptools.packages.find]
|
|
60
|
+
where = ["src"]
|
|
61
|
+
namespaces = false
|
|
62
|
+
|
|
63
|
+
# -----------------------------
|
|
64
|
+
# Formatting Tools
|
|
65
|
+
# -----------------------------
|
|
66
|
+
[tool.black]
|
|
67
|
+
line-length = 100
|
|
68
|
+
target-version = ["py311"]
|
|
69
|
+
|
|
70
|
+
[tool.isort]
|
|
71
|
+
profile = "black"
|
|
72
|
+
line_length = 100
|
|
73
|
+
src_paths = ["src", "tests"]
|
|
74
|
+
|
|
75
|
+
# -----------------------------
|
|
76
|
+
# Testing & Coverage
|
|
77
|
+
# -----------------------------
|
|
78
|
+
[tool.pytest.ini_options]
|
|
79
|
+
pythonpath = ["src"]
|
|
80
|
+
addopts = "-v --disable-warnings"
|
|
81
|
+
testpaths = ["tests"]
|
|
82
|
+
python_files = ["test_*.py"]
|
|
83
|
+
|
|
84
|
+
[tool.coverage.run]
|
|
85
|
+
branch = true
|
|
86
|
+
source = ["src"]
|
|
87
|
+
|
|
88
|
+
[tool.coverage.report]
|
|
89
|
+
show_missing = true
|
|
90
|
+
skip_covered = true
|
|
91
|
+
|
|
92
|
+
# -----------------------------
|
|
93
|
+
# Type Checking
|
|
94
|
+
# -----------------------------
|
|
95
|
+
[tool.mypy]
|
|
96
|
+
python_version = "3.12"
|
|
97
|
+
|
|
98
|
+
# --- Strictness for production code ---
|
|
99
|
+
disallow_untyped_defs = true
|
|
100
|
+
disallow_incomplete_defs = true
|
|
101
|
+
ignore_missing_imports = true
|
|
102
|
+
strict_optional = true
|
|
103
|
+
warn_unused_ignores = true
|
|
104
|
+
warn_unreachable = true
|
|
105
|
+
warn_return_any = true
|
|
106
|
+
show_error_codes = true
|
|
107
|
+
|
|
108
|
+
# --- Paths to exclude from main analysis ---
|
|
109
|
+
exclude = [
|
|
110
|
+
"build/",
|
|
111
|
+
"dist/",
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
# --- Override: Relax typing rules for test modules ---
|
|
115
|
+
[[tool.mypy.overrides]]
|
|
116
|
+
module = "tests.*"
|
|
117
|
+
disallow_untyped_defs = false
|
|
118
|
+
check_untyped_defs = false
|
|
119
|
+
ignore_missing_imports = true
|
|
120
|
+
|
|
121
|
+
# -----------------------------
|
|
122
|
+
# Linting
|
|
123
|
+
# -----------------------------
|
|
124
|
+
[tool.flake8]
|
|
125
|
+
max-line-length = 120
|
|
126
|
+
|
|
127
|
+
# E203: Black disagrees with slice whitespace rules
|
|
128
|
+
# W503: Black prefers line breaks before binary operators
|
|
129
|
+
# W292: Black intentionally removes trailing newline at EOF (Black behavior)
|
|
130
|
+
extend-ignore = ["E203", "W503", "W292"]
|
|
131
|
+
|
|
132
|
+
exclude = [
|
|
133
|
+
".git",
|
|
134
|
+
"__pycache__",
|
|
135
|
+
"build",
|
|
136
|
+
"dist",
|
|
137
|
+
"venv",
|
|
138
|
+
".venv",
|
|
139
|
+
".tox",
|
|
140
|
+
".pytest_cache",
|
|
141
|
+
"docs"
|
|
142
|
+
]
|
|
143
|
+
|
|
144
|
+
# -----------------------------
|
|
145
|
+
# Security (Bandit)
|
|
146
|
+
# -----------------------------
|
|
147
|
+
[tool.bandit]
|
|
148
|
+
# Rules intentionally skipped because they are either safe in this context or false positives.
|
|
149
|
+
# Skipped rules:
|
|
150
|
+
# B101 - assert_used: Safe since assertions are not used for security enforcement.
|
|
151
|
+
# B110 - try_except_pass: Handled via code review standards instead.
|
|
152
|
+
# B404 - import_subprocess: subprocess used safely for CLI operations (no user input).
|
|
153
|
+
# B603 - subprocess_without_shell_equals_true: All subprocess calls use shell=False.
|
|
154
|
+
# B607 - start_process_with_partial_path: Safe usage of 'gh' (GitHub CLI) in developer tools.
|
|
155
|
+
# B108 - hardcoded_tmp_directory: Acceptable since temp dirs are user- and timestamp-specific.
|
|
156
|
+
|
|
157
|
+
skips = ["B101", "B110", "B404", "B603", "B607", "B108"]
|
|
158
|
+
|
|
159
|
+
# Bandit target directories (recursive)
|
|
160
|
+
targets = ["src"]
|
|
161
|
+
recursive = true
|
|
162
|
+
|
|
163
|
+
# Exclude test code from Bandit scans
|
|
164
|
+
exclude = ["tests"]
|
|
165
|
+
|
|
166
|
+
# -----------------------------
|
|
167
|
+
# Docstring Style Checkers
|
|
168
|
+
# -----------------------------
|
|
169
|
+
[tool.pydocstyle]
|
|
170
|
+
convention = "google"
|
|
171
|
+
add-ignore = [
|
|
172
|
+
"D107", # Missing docstring in __init__
|
|
173
|
+
"D203", # 1 blank line required before class docstring
|
|
174
|
+
]
|
|
175
|
+
match-dir = "src"
|
|
176
|
+
|
|
177
|
+
[tool.darglint]
|
|
178
|
+
docstring_style = "google"
|
|
179
|
+
strictness = "short"
|
|
180
|
+
ignore_regex = "(^test_)"
|
|
181
|
+
message_template = "{path}:{line}: {msg_id} {msg}"
|
|
182
|
+
|
|
183
|
+
# -----------------------------------------------------------
|
|
184
|
+
# bump-my-version for manual version bumps
|
|
185
|
+
# -----------------------------------------------------------
|
|
186
|
+
[tool.bumpversion]
|
|
187
|
+
current_version = "0.1.0" # optional but nice to have in one place
|
|
188
|
+
commit = true
|
|
189
|
+
tag = true
|
|
190
|
+
tag_name = "v{new_version}"
|
|
191
|
+
message = "chore(release): bump version to v{new_version} [skip ci]"
|
|
192
|
+
hooks = true
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
[[tool.bumpversion.files]]
|
|
196
|
+
filename = ".version" # plain text file with just the version
|
|
197
|
+
|
|
198
|
+
[[tool.bumpversion.files]]
|
|
199
|
+
filename = "pyproject.toml"
|
|
200
|
+
search = 'version = "{current_version}"'
|
|
201
|
+
replace = 'version = "{new_version}"'
|
|
202
|
+
|
|
203
|
+
[[tool.bumpversion.files]]
|
|
204
|
+
filename = "src/jps_observability_utils/__init__.py" # change if your package name differs
|
|
205
|
+
search = '__version__ = "{current_version}"'
|
|
206
|
+
replace = '__version__ = "{new_version}"'
|
|
207
|
+
|
|
208
|
+
[tool.git-changelog]
|
|
209
|
+
template = "keepachangelog" # produces beautiful Keep a Changelog format
|
|
210
|
+
output = "CHANGELOG.md"
|