Closed xTrekStorex closed 3 months ago
Hi, thanks for your issue. Could you please add repo with steps, it helps me improve this library
Hi, thanks for your issue. Could you please add repo with steps, it helps me improve this library
Hi, do you mean #10 ?
Is your feature request related to a problem? Please describe. When more than one instance of playwright with this reporter are run in parallel, e.g. when tests are spread across multiple instances via sharding, the remote written timeseries clash in prometheus with either out of order samples or duplicate samples for timestamp. This is mainly caused by metrics like pw_tests_pass_count not setting unique labels. For scrape targets this is usually worked around using the instance and job labels. For remote write there usually are external_labels which can be added to each series - e.g. source_prometheus.
Describe the solution you'd like I'd like an extra_labels option for the reporter. These could be done like headers and passed as 'labels' in options/config for prometheus-remote-write just by adding 'labels' to PrometheusOptions & the constructor.
Describe alternatives you've considered A hardcoded label instance=$hostname or similar to identify the instance writing to prometheus. Added here to be inherited by all metrics: https://github.com/vitalics/playwright-prometheus-remote-write-reporter/blob/main/src/helpers.ts#L15