• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 26080722777

19 May 2026 06:37AM UTC coverage: 52.106% (-11.5%) from 63.597%
26080722777

Pull #23250

github

web-flow
Merge 63ec06323 into 2693df832
Pull Request #23250: Feature: Add generic option to docker image

12 of 50 new or added lines in 3 files covered. (24.0%)

5382 existing lines in 201 files now uncovered.

32053 of 61515 relevant lines covered (52.11%)

1.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/python/pants/backend/observability/opentelemetry/processor.py
1
# Copyright 2026 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

UNCOV
4
from __future__ import annotations
×
5

UNCOV
6
import datetime
×
UNCOV
7
import enum
×
UNCOV
8
from dataclasses import dataclass
×
UNCOV
9
from typing import Any, Mapping, Protocol
×
10

UNCOV
11
from pants.util.frozendict import FrozenDict
×
12

13

UNCOV
14
class Level(enum.Enum):
×
UNCOV
15
    DEBUG = "DEBUG"
×
UNCOV
16
    ERROR = "ERROR"
×
UNCOV
17
    INFO = "INFO"
×
UNCOV
18
    TRACE = "TRACE"
×
UNCOV
19
    WARN = "WARN"
×
20

21

UNCOV
22
@dataclass(frozen=True)
×
UNCOV
23
class IncompleteWorkunit:
×
24
    """An incomplete workunit which only knows its start time."""
25

UNCOV
26
    name: str
×
UNCOV
27
    span_id: str
×
UNCOV
28
    parent_ids: tuple[str, ...]
×
UNCOV
29
    level: Level
×
UNCOV
30
    description: str | None
×
UNCOV
31
    start_time: datetime.datetime
×
32

UNCOV
33
    @property
×
UNCOV
34
    def primary_parent_id(self) -> str | None:
×
35
        if len(self.parent_ids) > 0:
×
36
            return self.parent_ids[0]
×
37
        return None
×
38

39

UNCOV
40
@dataclass(frozen=True)
×
UNCOV
41
class Workunit(IncompleteWorkunit):
×
42
    """The final workunit which knows when it completed as well."""
43

UNCOV
44
    end_time: datetime.datetime
×
UNCOV
45
    metadata: FrozenDict[str, Any]
×
46

47

UNCOV
48
class ProcessorContext(Protocol):
×
49
    def get_metrics(self) -> Mapping[str, int]: ...
50

51

UNCOV
52
class Processor(Protocol):
×
53
    """Protocol for emitter implementations."""
54

55
    def initialize(self) -> None: ...
56

57
    def start_workunit(
58
        self, workunit: IncompleteWorkunit, *, context: ProcessorContext
59
    ) -> None: ...
60

61
    def complete_workunit(self, workunit: Workunit, *, context: ProcessorContext) -> None: ...
62

63
    def finish(
64
        self, timeout: datetime.timedelta | None = None, *, context: ProcessorContext
65
    ) -> None: ...
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc