Skip to content

windowsservicereceiver: services with access denied affect data from other services #44087

@akumetsu183

Description

@akumetsu183

Component(s)

receiver/windowsservice

What happened?

Description

Here, I am not 100% sure what is happenning.

But the TLDR is:

  • if you use include_services, and specify list of services that are accessible, it works OK. Metric with datapoints are exported
    include_services:
      - "Spooler" # should be OK under admin
  • then if you append the list, and include just ONE service name, that logs "Access is denied.", you get 0 metrics. Even under administrator.
    include_services:
      - "Spooler" # should be OK under admin
      - "MDCoreSvc" # this logs error, even under admin. Now nothing gets sent, even for Spooler service above

I suspect that the access denied results in datapoints not being set to the metric, or something like that, but they get sent down anyway. And since I use batch processor, the entire batch is thrown away. (just a suspition)

It would be great if that malformed thing (whatever it is) never got created or sent down the pipeline.
I would also like if only WARNINGS were logged in this case, but all services that can be monitored should still send data.

Important

this makes the default configuration/usecase of "monitoring all services", non functional. Because on my windows machine, there are plenty of services suffering from the "Access is denied". Would be great If the names of the services would be logged, so user can know to blacklist them. Currently there is no indication. (also should be warning only I think). FYI I see also "Element not found" and other issues lurking in there.
Image

Steps to Reproduce

Try to run the service with the config below, on a windows machine.
"Spooler" service should be OK, "MDCoreSvc" should repro the issue. (even under administrator)

Expected Result

I would expect logs to contain WARNINGS about services that the process cannot access, and their names. (additional settings to avoid logging the warrning would be icing on the cake, as that will pollute the logs a bit I can imagine)
Those should not produce any metrics/datapoints.
The rest of accessible services should be unaffected.

File exporter logs metrics

{"resourceMetrics":[{"resource":{},"scopeMetrics"...
{"resourceMetrics":[{"resource":{},"scopeMetrics"...
{"resourceMetrics":[{"resource":{},"scopeMetrics"...

Actual Result

Batch gets thrown away on export due to one bad service.
No data gets exported, even if most of the services are accessible, but just one is not. (even under admin)

fileexporter result of metrics

{}
{}
{}
{}

Collector version

0.136.0

Environment information

Environment

Custom 0.136.0 of the collector, and LATEST main windowsservice receiver (brought back to 136 in order for the thing to be buildable).
But all the info should hold true on latest main to date. 🤞

OpenTelemetry Collector configuration

receivers:
  windowsservice:
    collection_interval: 30s
    include_services:
      - "Spooler"       # this should be accessible to administrator
      - "MDCoreSvc"     # this is not accessible to admin, on my machine. But exists.

processors:
  # Batch processor to group telemetry data
  batch:
    timeout: 1s
    send_batch_size: 100

exporters:
  # File exporter writes telemetry to a local file for inspection
  file/metrics:
    path: ./_debug/output_metrics.jsonl
  debug:

service:
  # Service configuration defines the telemetry pipelines
  # Add some components for debugging purposes
  pipelines:
    metrics:
      receivers: [windowsservice]
      exporters: [file/metrics, debug]

Log output

This is a log output of just this configuration

receivers:
  windowsservice:
    collection_interval: 30s
2025-11-07T08:50:47.087+0100    info    [email protected]/service.go:262 Everything is ready. Begin running and processing data. {"resource": {"service.instance.id": "6dd585f6-7d22-4b30-b20a-5b8aca1b54f4", "service.name": "solarwinds-otel-collector-verified", "service.version": "0.136.4"}}
2025-11-07T08:50:48.324+0100    error   [email protected]/obs_metrics.go:61        Error scraping metrics  {"resource": {"service.instance.id": "6dd585f6-7d22-4b30-b20a-5b8aca1b54f4", "service.name": "solarwinds-otel-collector-verified", "service.version": "0.136.4"}, "otelcol.component.id": "windowsservice", "otelcol.component.kind": "receiver", "otelcol.signal": "metrics", "error": "Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; The system cannot find the file specified.; The system cannot find the file specified.; Access is denied.; Access is denied.; Element not found.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; The system cannot find the file specified.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.; Access is denied.", "errorCauses": [{"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "The system cannot find the file specified."}, {"error": "The system cannot find the file specified."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Element not found."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "The system cannot find the file specified."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}, {"error": "Access is denied."}]}
go.opentelemetry.io/collector/scraper/scraperhelper.wrapObsMetrics.func1
        go.opentelemetry.io/collector/scraper/[email protected]/obs_metrics.go:61
go.opentelemetry.io/collector/scraper.ScrapeMetricsFunc.ScrapeMetrics
        go.opentelemetry.io/collector/[email protected]/metrics.go:24
go.opentelemetry.io/collector/scraper/scraperhelper.scrapeMetrics
        go.opentelemetry.io/collector/scraper/[email protected]/controller.go:256
go.opentelemetry.io/collector/scraper/scraperhelper.NewMetricsController.func1
        go.opentelemetry.io/collector/scraper/[email protected]/controller.go:228
go.opentelemetry.io/collector/scraper/scraperhelper.(*controller[...]).startScraping.func1
        go.opentelemetry.io/collector/scraper/[email protected]/controller.go:171
2025-11-07T08:50:48.422+0100    error   internal/queue_sender.go:42     Exporting failed. Dropping data.        {"resource": {"service.instance.id": "6dd585f6-7d22-4b30-b20a-5b8aca1b54f4", "service.name": "solarwinds-otel-collector-verified", "service.version": "0.136.4"}, "otelcol.component.id": "otlp", "otelcol.component.kind": "exporter", "otelcol.signal": "metrics", "error": "not retryable error: Permanent error: rpc error: code = InvalidArgument desc = Metric validation removed all of the passed metrics", "dropped_items": 0}
go.opentelemetry.io/collector/exporter/exporterhelper/internal.NewQueueSender.func1
        go.opentelemetry.io/collector/exporter/[email protected]/internal/queue_sender.go:42
go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch.(*disabledBatcher[...]).Consume
        go.opentelemetry.io/collector/exporter/[email protected]/internal/queuebatch/disabled_batcher.go:23
go.opentelemetry.io/collector/exporter/exporterhelper/internal/queue.(*asyncQueue[...]).Start.func1
        go.opentelemetry.io/collector/exporter/[email protected]/internal/queue/async_queue.go:49

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions