Beispiel #1
0
 def __init__(self, meter: Meter, labels: Dict[str, str]):
     self._meter = meter
     self._labels = labels
     # Patch requests
     requests.Session.request = dependency_patch
     meter.register_observer(
         callback=self._track_dependency_rate,
         name="\\ApplicationInsights\\Dependency Calls/Sec",
         description="Outgoing Requests per second",
         unit="rps",
         value_type=int,
     )
 def __init__(self, meter: Meter, labels: Dict[str, str]):
     self._meter = meter
     self._labels = labels
     # Create performance metrics
     meter.register_observer(
         callback=self._track_cpu,
         name="\\Processor(_Total)\\% Processor Time",
         description="Processor time as a percentage",
         unit="percentage",
         value_type=float,
     )
     meter.register_observer(
         callback=self._track_memory,
         name="\\Memory\\Available Bytes",
         description="Amount of available memory in bytes",
         unit="byte",
         value_type=int,
     )
     meter.register_observer(
         callback=self._track_process_cpu,
         name="\\Process(??APP_WIN32_PROC??)\\% Processor Time",
         description="Process CPU usage as a percentage",
         unit="percentage",
         value_type=float,
     )
     meter.register_observer(
         callback=self._track_process_memory,
         name="\\Process(??APP_WIN32_PROC??)\\Private Bytes",
         description="Amount of memory process has used in bytes",
         unit="byte",
         value_type=int,
     )
Beispiel #3
0
    def __init__(self, meter: Meter, labels: Dict[str, str]):
        self._meter = meter
        self._labels = labels
        # Patch the HTTPServer handler to track request information
        HTTPServer.__init__ = server_patch

        meter.register_observer(
            callback=self._track_request_duration,
            name="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time",
            description="Incoming Requests Average Execution Time",
            unit="milliseconds",
            value_type=int,
        )

        meter.register_observer(
            callback=self._track_request_rate,
            name="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec",
            description="Incoming Requests Average Execution Rate",
            unit="rps",
            value_type=int,
        )
    def __init__(self, meter: Meter, labels: Dict[str, str]):
        self._meter = meter
        self._labels = labels
        # Patch requests
        requests.Session.request = dependency_patch

        meter.register_observer(
            callback=self._track_dependency_duration,
            name="\\ApplicationInsights\\Dependency Call Duration",
            description="Average Outgoing Requests duration",
            unit="milliseconds",
            value_type=float,
            observer_type=UpDownSumObserver,
        )
        meter.register_observer(
            callback=self._track_failure_rate,
            name="\\ApplicationInsights\\Dependency Calls Failed/Sec",
            description="Failed Outgoing Requests per second",
            unit="rps",
            value_type=float,
            observer_type=UpDownSumObserver,
        )
        meter.register_observer(
            callback=self._track_dependency_rate,
            name="\\ApplicationInsights\\Dependency Calls/Sec",
            description="Outgoing Requests per second",
            unit="rps",
            value_type=float,
            observer_type=UpDownSumObserver,
        )
Beispiel #5
0
    def __init__(
        self,
        meter: Meter,
        labels: Dict[str, str],
    ):
        self._meter = meter
        self._labels = labels
        # Patch the HTTPServer handler to track request information
        HTTPServer.__init__ = server_patch

        meter.register_observer(
            callback=self._track_request_failed_rate,
            name="\\ApplicationInsights\\Requests Failed/Sec",
            description="Incoming Requests Failed Rate",
            unit="rps",
            value_type=float,
            observer_type=UpDownSumObserver,
        )
        meter.register_observer(
            callback=self._track_request_duration,
            name="\\ApplicationInsights\\Request Duration",
            description="Incoming Requests Average Execution Time",
            unit="milliseconds",
            value_type=float,
            observer_type=UpDownSumObserver,
        )
        meter.register_observer(
            callback=self._track_request_rate,
            name="\\ApplicationInsights\\Requests/Sec",
            description="Incoming Requests Rate",
            unit="rps",
            value_type=float,
            observer_type=UpDownSumObserver,
        )
    def __init__(
        self,
        meter: Meter,
        labels: Dict[str, str],
        span_processor: AzureMetricsSpanProcessor,
    ):
        self._meter = meter
        self._labels = labels
        self._span_processor = span_processor

        meter.register_observer(
            callback=self._track_dependency_duration,
            name="\\ApplicationInsights\\Dependency Call Duration",
            description="Average Outgoing Requests duration",
            unit="milliseconds",
            value_type=int,
            observer_type=UpDownSumObserver,
        )
        meter.register_observer(
            callback=self._track_failure_rate,
            name="\\ApplicationInsights\\Dependency Calls Failed/Sec",
            description="Failed Outgoing Requests per second",
            unit="rps",
            value_type=float,
            observer_type=UpDownSumObserver,
        )
        meter.register_observer(
            callback=self._track_dependency_rate,
            name="\\ApplicationInsights\\Dependency Calls/Sec",
            description="Outgoing Requests per second",
            unit="rps",
            value_type=float,
            observer_type=UpDownSumObserver,
        )
Beispiel #7
0
    def __init__(
        self,
        meter: Meter,
        labels: Dict[str, str],
        span_processor: AzureMetricsSpanProcessor,
        collection_type: AutoCollectionType,
    ):
        self._meter = meter
        self._labels = labels
        self._span_processor = span_processor

        if collection_type == AutoCollectionType.LIVE_METRICS:
            meter.register_observer(
                callback=self._track_request_failed_rate,
                name="\\ApplicationInsights\\Requests Failed/Sec",
                description="Incoming Requests Failed Rate",
                unit="rps",
                value_type=float,
                observer_type=UpDownSumObserver,
            )
        meter.register_observer(
            callback=self._track_request_duration,
            name="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time",
            description="Incoming Requests Average Execution Time",
            unit="milliseconds",
            value_type=int,
            observer_type=UpDownSumObserver,
        )
        meter.register_observer(
            callback=self._track_request_rate,
            name="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec",
            description="Incoming Requests Rate",
            unit="rps",
            value_type=float,
            observer_type=UpDownSumObserver,
        )