devlogs 2.0.2__tar.gz → 2.0.3__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.
Files changed (72) hide show
  1. {devlogs-2.0.2/src/devlogs.egg-info → devlogs-2.0.3}/PKG-INFO +1 -1
  2. {devlogs-2.0.2 → devlogs-2.0.3}/pyproject.toml +1 -1
  3. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/collector/server.py +42 -1
  4. devlogs-2.0.3/src/devlogs/version.py +3 -0
  5. {devlogs-2.0.2 → devlogs-2.0.3/src/devlogs.egg-info}/PKG-INFO +1 -1
  6. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs.egg-info/SOURCES.txt +1 -0
  7. {devlogs-2.0.2 → devlogs-2.0.3}/LICENSE +0 -0
  8. {devlogs-2.0.2 → devlogs-2.0.3}/MANIFEST.in +0 -0
  9. {devlogs-2.0.2 → devlogs-2.0.3}/README.md +0 -0
  10. {devlogs-2.0.2 → devlogs-2.0.3}/setup.cfg +0 -0
  11. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/__init__.py +0 -0
  12. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/__main__.py +0 -0
  13. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/build_info.py +0 -0
  14. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/cli.py +0 -0
  15. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/collector/__init__.py +0 -0
  16. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/collector/auth.py +0 -0
  17. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/collector/cli.py +0 -0
  18. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/collector/errors.py +0 -0
  19. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/collector/forwarder.py +0 -0
  20. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/collector/ingestor.py +0 -0
  21. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/collector/schema.py +0 -0
  22. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/config.py +0 -0
  23. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/context.py +0 -0
  24. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/demo.py +0 -0
  25. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/devlogs_client.py +0 -0
  26. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/formatting.py +0 -0
  27. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/handler.py +0 -0
  28. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/jenkins/__init__.py +0 -0
  29. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/jenkins/cli.py +0 -0
  30. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/jenkins/core.py +0 -0
  31. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/levels.py +0 -0
  32. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/mcp/__init__.py +0 -0
  33. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/mcp/server.py +0 -0
  34. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/opensearch/__init__.py +0 -0
  35. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/opensearch/client.py +0 -0
  36. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/opensearch/indexing.py +0 -0
  37. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/opensearch/mappings.py +0 -0
  38. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/opensearch/queries.py +0 -0
  39. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/retention.py +0 -0
  40. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/scrub.py +0 -0
  41. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/time_utils.py +0 -0
  42. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/web/__init__.py +0 -0
  43. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/web/server.py +0 -0
  44. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/web/static/devlogs.css +0 -0
  45. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/web/static/devlogs.js +0 -0
  46. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/web/static/index.html +0 -0
  47. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs/wrapper.py +0 -0
  48. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs.egg-info/dependency_links.txt +0 -0
  49. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs.egg-info/entry_points.txt +0 -0
  50. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs.egg-info/requires.txt +0 -0
  51. {devlogs-2.0.2 → devlogs-2.0.3}/src/devlogs.egg-info/top_level.txt +0 -0
  52. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_build_info.py +0 -0
  53. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_cli.py +0 -0
  54. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_collector_auth.py +0 -0
  55. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_collector_config.py +0 -0
  56. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_collector_schema.py +0 -0
  57. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_collector_server.py +0 -0
  58. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_config.py +0 -0
  59. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_context.py +0 -0
  60. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_devlogs_client.py +0 -0
  61. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_formatting.py +0 -0
  62. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_handler.py +0 -0
  63. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_indexing.py +0 -0
  64. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_levels.py +0 -0
  65. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_mappings.py +0 -0
  66. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_mcp_server.py +0 -0
  67. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_opensearch_client.py +0 -0
  68. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_opensearch_queries.py +0 -0
  69. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_retention.py +0 -0
  70. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_scrub.py +0 -0
  71. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_time_utils.py +0 -0
  72. {devlogs-2.0.2 → devlogs-2.0.3}/tests/test_web.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devlogs
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: Developer-focused logging library for Python with OpenSearch integration.
5
5
  Author-email: Dan Driscoll <dan@thedandriscoll.org>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "devlogs"
7
- version = "2.0.2"
7
+ version = "2.0.3"
8
8
  description = "Developer-focused logging library for Python with OpenSearch integration."
9
9
  requires-python = ">=3.11"
10
10
  readme = "README.md"
@@ -5,6 +5,8 @@
5
5
  # - Ingest mode: write directly to OpenSearch
6
6
 
7
7
  import json
8
+ import platform
9
+ from contextlib import asynccontextmanager
8
10
  from typing import Optional
9
11
 
10
12
  from fastapi import FastAPI, Request, Response, HTTPException
@@ -17,6 +19,7 @@ from .schema import (
17
19
  validate_record,
18
20
  normalize_records,
19
21
  enrich_record,
22
+ get_current_timestamp,
20
23
  )
21
24
  from .errors import (
22
25
  CollectorError,
@@ -33,12 +36,49 @@ from .auth import (
33
36
  )
34
37
  from .forwarder import forward_request
35
38
  from .ingestor import ingest_records
39
+ from ..version import __version__
40
+
41
+ @asynccontextmanager
42
+ async def lifespan(app: FastAPI):
43
+ """Emit a startup trace to the index so operators can see when the collector started."""
44
+ cfg = load_config()
45
+ mode = cfg.get_collector_mode()
46
+
47
+ if mode == "ingest":
48
+ try:
49
+ client = get_opensearch_client()
50
+ doc = DevlogsRecord(
51
+ application="devlogs-collector",
52
+ component="lifecycle",
53
+ timestamp=get_current_timestamp(),
54
+ message="Collector started",
55
+ level="info",
56
+ area="startup",
57
+ version=__version__,
58
+ fields={
59
+ "mode": mode,
60
+ "host": platform.node(),
61
+ "opensearch_host": cfg.opensearch_host,
62
+ "index": cfg.index,
63
+ },
64
+ )
65
+ doc.collected_ts = get_current_timestamp()
66
+ doc.client_ip = "127.0.0.1"
67
+ doc._identity = {"mode": "internal"}
68
+ client.index(index=cfg.index, body=doc.to_dict())
69
+ except Exception:
70
+ # Startup trace is best-effort; don't block the server
71
+ pass
72
+
73
+ yield
74
+
36
75
 
37
76
  # Create FastAPI app for collector
38
77
  app = FastAPI(
39
78
  title="Devlogs Collector",
40
79
  description="HTTP log collector for the devlogs format",
41
- version="1.0.0",
80
+ version=__version__,
81
+ lifespan=lifespan,
42
82
  )
43
83
 
44
84
 
@@ -83,6 +123,7 @@ async def health():
83
123
  return {
84
124
  "status": "healthy",
85
125
  "mode": mode,
126
+ "version": __version__,
86
127
  }
87
128
 
88
129
 
@@ -0,0 +1,3 @@
1
+ import os
2
+
3
+ __version__ = os.environ.get("BUILD_VERSION", "development")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devlogs
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: Developer-focused logging library for Python with OpenSearch integration.
5
5
  Author-email: Dan Driscoll <dan@thedandriscoll.org>
6
6
  License: MIT License
@@ -16,6 +16,7 @@ src/devlogs/levels.py
16
16
  src/devlogs/retention.py
17
17
  src/devlogs/scrub.py
18
18
  src/devlogs/time_utils.py
19
+ src/devlogs/version.py
19
20
  src/devlogs/wrapper.py
20
21
  src/devlogs.egg-info/PKG-INFO
21
22
  src/devlogs.egg-info/SOURCES.txt
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes