projects/guix·blob ruby-team · refs

860 lines · 33.8 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2018 Pierre Neidhardt <[email protected]>
3;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2018, 2019, 2020 Leo Famulari <[email protected]>
5;;; Copyright © 2020 Efraim Flashner <[email protected]>
6;;; Copyright © 2021 Sarah Morgensen <[email protected]>
7;;; Copyright © 2024 Dominic Martinez <[email protected]>
8;;; Copyright © 2024 Jesse Eisses <[email protected]>
9;;; Copyright © 2024 Sharlatan Hellseher <[email protected]>
10;;; Copyright © 2024 Troy Figiel <[email protected]>
11;;;
12;;; This file is part of GNU Guix.
13;;;
14;;; GNU Guix is free software; you can redistribute it and/or modify it
15;;; under the terms of the GNU General Public License as published by
16;;; the Free Software Foundation; either version 3 of the License, or (at
17;;; your option) any later version.
18;;;
19;;; GNU Guix is distributed in the hope that it will be useful, but
20;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22;;; GNU General Public License for more details.
23;;;
24;;; You should have received a copy of the GNU General Public License
25;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27(define-module (gnu packages prometheus)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix build-system go)
30 #:use-module (guix gexp)
31 #:use-module (guix git-download)
32 #:use-module (guix packages)
33 #:use-module (guix utils)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages golang)
36 #:use-module (gnu packages golang-build)
37 #:use-module (gnu packages golang-check)
38 #:use-module (gnu packages golang-compression)
39 #:use-module (gnu packages golang-crypto)
40 #:use-module (gnu packages golang-web)
41 #:use-module (gnu packages golang-xyz))
42
43;;; Commentary:
44;;;
45;;; Libraries and commands related to, or provided by Prometheus project
46;;; <https://prometheus.io>.
47;;;
48;;; Please: Try to add new module packages in alphabetic order.
49;;;
50;;; Code:
51
52;;;
53;;; Libraries:
54;;;
55
56(define-public go-contrib-go-opencensus-io-exporter-prometheus
57 (package
58 (name "go-contrib-go-opencensus-io-exporter-prometheus")
59 (version "0.4.2")
60 (source
61 (origin
62 (method git-fetch)
63 (uri (git-reference
64 (url
65 "https://github.com/census-ecosystem/opencensus-go-exporter-prometheus")
66 (commit (string-append "v" version))))
67 (file-name (git-file-name name version))
68 (sha256
69 (base32 "0n09d2nbng4bws9vi2ddq2ffv9hr0c3i9mif6fkjr4chyyyiy8ik"))))
70 (build-system go-build-system)
71 (arguments
72 (list
73 #:import-path "contrib.go.opencensus.io/exporter/prometheus"))
74 (propagated-inputs
75 (list go-github-com-google-go-cmp
76 go-github-com-prometheus-client-golang
77 go-github-com-prometheus-statsd-exporter
78 go-go-opencensus-io))
79 (home-page "https://github.com/census-ecosystem/opencensus-go-exporter-prometheus")
80 (synopsis "OpenCensus Go Prometheus Exporter")
81 (description
82 "Package prometheus contains a Prometheus exporter that supports
83exporting @code{OpenCensus} views as Prometheus metrics.")
84 (license license:asl2.0)))
85
86(define-public go-github-com-grpc-ecosystem-go-grpc-prometheus
87 (package
88 (name "go-github-com-grpc-ecosystem-go-grpc-prometheus")
89 (version "1.2.0")
90 (source
91 (origin
92 (method git-fetch)
93 (uri (git-reference
94 (url "https://github.com/grpc-ecosystem/go-grpc-prometheus")
95 (commit (string-append "v" version))))
96 (file-name (git-file-name name version))
97 (sha256
98 (base32 "1lzk54h7np32b3acidg1ggbn8ppbnns0m71gcg9d1qkkdh8zrijl"))))
99 (build-system go-build-system)
100 (arguments
101 (list
102 ;; Source only package, [email protected] still needs
103 ;; it while the project is archived. Remove when no longer required.
104 #:skip-build? #t
105 #:tests? #f
106 #:import-path "github.com/grpc-ecosystem/go-grpc-prometheus"))
107 (propagated-inputs
108 (list go-github-com-prometheus-client-golang
109 go-golang-org-x-net
110 go-google-golang-org-grpc))
111 (home-page "https://github.com/grpc-ecosystem/go-grpc-prometheus")
112 (synopsis "Go gRPC Interceptors for Prometheus monitoring")
113 (description
114 "This package implements a Prometheus monitoring for your
115@url{https://github.com/grpc/grpc-go, gRPC Go} servers and clients.")
116 (license license:asl2.0)))
117
118(define-public go-github-com-mwitkow-go-conntrack
119 (package
120 (name "go-github-com-mwitkow-go-conntrack")
121 (version "0.0.0-20190716064945-2f068394615f")
122 (source
123 (origin
124 (method git-fetch)
125 (uri (git-reference
126 (url "https://github.com/mwitkow/go-conntrack")
127 (commit (go-version->git-ref version))))
128 (file-name (git-file-name name version))
129 (sha256
130 (base32 "0ymjmy12ks7smgwmrwsa5kf07d9w5kpk1dn650azlzr61b561aw7"))))
131 (build-system go-build-system)
132 (arguments
133 (list
134 #:tests? #f
135 #:import-path "github.com/mwitkow/go-conntrack"
136 #:phases
137 #~(modify-phases %standard-phases
138 ;; Breaking cycle:
139 ;; go-github-com-prometheus-common ->
140 ;; go-github-com-prometheus-client-golang ->
141 ;; go-github-com-mwitkow-go-conntrack ->
142 ;; go-github-com-prometheus-common
143 (delete 'build))))
144 (native-inputs
145 (list go-github-com-stretchr-testify))
146 (propagated-inputs
147 (list go-github-com-jpillora-backoff
148 go-github-com-munnerz-goautoneg
149 ;; go-github-com-prometheus-client-golang
150 go-golang-org-x-net))
151 (home-page "https://github.com/mwitkow/go-conntrack")
152 (synopsis "Go middleware for @code{net.Conn} tracking")
153 (description
154 "@url{https://prometheus.io/,Prometheus} monitoring and
155@url{https://godoc.org/golang.org/x/net/trace#@code{EventLog,(code}
156x/net/trace)} tracing wrappers @code{net.Conn}, both inbound
157(@@code{net.Listener}) and outbound (@@code{net.Dialer}).")
158 (license license:asl2.0)))
159
160(define-public go-github-com-nbrownus-go-metrics-prometheus
161 (package
162 (name "go-github-com-nbrownus-go-metrics-prometheus")
163 (version "0.0.0-20210712211119-974a6260965f")
164 (source
165 (origin
166 (method git-fetch)
167 (uri (git-reference
168 (url "https://github.com/nbrownus/go-metrics-prometheus")
169 (commit (go-version->git-ref version))))
170 (file-name (git-file-name name version))
171 (sha256
172 (base32 "1kl9l08aas544627zmhkgp843qx94sxs4inxm20nw1hx7gp79dz0"))))
173 (build-system go-build-system)
174 (arguments
175 (list
176 ;; The project looks abandoned, tests failed with a new go-metrics, see
177 ;; <https://github.com/nbrownus/go-metrics-prometheus/pull/2>.
178 #:tests? #f
179 #:import-path "github.com/nbrownus/go-metrics-prometheus"))
180 (native-inputs
181 (list go-github-com-stretchr-testify))
182 (propagated-inputs
183 (list go-github-com-prometheus-client-golang
184 go-github-com-rcrowley-go-metrics))
185 (home-page "https://github.com/nbrownus/go-metrics-prometheus")
186 (synopsis "Prometheus support for go-metrics")
187 (description
188 "This package provides a reporter for the @code{go-metrics} library which
189posts the metrics to the Prometheus client registry and just updates the
190registry.")
191 (license license:asl2.0)))
192
193(define-public go-github-com-prometheus-alertmanager
194 (package
195 (name "go-github-com-prometheus-alertmanager")
196 (version "0.31.1") ;XXX: newer versions depend on buf
197 (source
198 (origin
199 (method git-fetch)
200 (uri (git-reference
201 (url "https://github.com/prometheus/alertmanager")
202 (commit (string-append "v" version))))
203 (file-name (git-file-name name version))
204 (sha256
205 (base32 "0r791bcj8sbxfjwiwwxik27q57lb19018p1zlbaczg3ljrp3chqy"))))
206 (build-system go-build-system)
207 (arguments
208 (list
209 #:skip-build? #t
210 #:import-path "github.com/prometheus/alertmanager"
211 #:unpack-path "github.com/prometheus/alertmanager"
212 #:embed-files #~(list ".*\\.css" ".*\\.html" ".*\\.json")
213 #:test-flags
214 #~(list "-skip" (string-join
215 ;; Tests expecting alertmanager binary.
216 (list "TestAddAlerts"
217 "TestAddSilence"
218 "TestAddUTF8Alerts"
219 "TestAddUTF8Silences"
220 "TestAlertGetReturnsCurrentAlertStatus"
221 "TestAlwaysInhibiting"
222 "TestBatching"
223 "TestCannotAddUTF8AlertsInClassicMode"
224 "TestCannotAddUTF8SilencesInClassicMode"
225 "TestClusterDeduplication"
226 "TestClusterVSInstance"
227 "TestColdStart"
228 "TestEmailRejected"
229 "TestEmptyInhibitionRule"
230 "TestFilterAlertRequest"
231 "TestFinalAdvertiseAddr"
232 "TestInhibiting"
233 "TestInstallingNewTracerProvider"
234 "TestMergeAlerts"
235 "TestMergeAlertsWithEndsAt"
236 "TestReinstallingTracerProvider"
237 "TestReinstallingTracerProviderWithTLS"
238 "TestReload"
239 "TestRepeat"
240 "TestResolved"
241 "TestResolvedFilter"
242 "TestRetry"
243 "TestSendAlertsToUTF8Route"
244 "TestSilenceDelete"
245 "TestSilencing"
246 "TestTracerProviderShutdown"
247 "TestUninstallingTracerProvider"
248 "TestWebWithPrefix"
249 "TestWebhookTimeout")
250 "|"))
251 #:phases
252 #~(modify-phases %standard-phases
253 (add-after 'unpack 'remove-broken-tests
254 (lambda* (#:key tests? unpack-path #:allow-other-keys)
255 (with-directory-excursion (string-append "src/" unpack-path)
256 ;; panic: unable to access amtool binary: error accessing
257 ;; amtool command, try 'make build' to generate the file. stat
258 ;; ../../../amtool: no such file or directory
259 (delete-file "test/cli/acceptance/cli_test.go"))))
260 (add-after 'unpack 'remove-examples
261 (lambda* (#:key tests? unpack-path #:allow-other-keys)
262 (with-directory-excursion (string-append "src/" unpack-path)
263 (delete-file-recursively "examples")))))))
264 (native-inputs
265 (list go-github-com-emersion-go-smtp
266 go-github-com-kylelemons-godebug
267 go-github-com-stretchr-testify))
268 (propagated-inputs
269 (list go-github-com-kimmachinegun-automemlimit
270 go-github-com-alecthomas-kingpin-v2
271 go-github-com-alecthomas-units
272 go-github-com-aws-aws-sdk-go-v2
273 go-github-com-aws-aws-sdk-go-v2-config
274 go-github-com-aws-aws-sdk-go-v2-credentials
275 go-github-com-aws-aws-sdk-go-v2-service-sns
276 go-github-com-aws-aws-sdk-go-v2-service-sts
277 go-github-com-aws-smithy-go
278 go-github-com-cenkalti-backoff-v4
279 go-github-com-cespare-xxhash-v2
280 go-github-com-coder-quartz
281 go-github-com-go-openapi-analysis
282 go-github-com-go-openapi-errors
283 go-github-com-go-openapi-loads
284 go-github-com-go-openapi-runtime
285 go-github-com-go-openapi-spec
286 go-github-com-go-openapi-strfmt
287 go-github-com-go-openapi-swag
288 go-github-com-go-openapi-validate
289 go-github-com-gogo-protobuf
290 go-github-com-google-uuid
291 go-github-com-hashicorp-go-sockaddr
292 go-github-com-hashicorp-golang-lru-v2
293 go-github-com-hashicorp-memberlist
294 go-github-com-jessevdk-go-flags
295 go-github-com-matttproud-golang-protobuf-extensions
296 go-github-com-oklog-run
297 go-github-com-oklog-ulid-v2
298 go-github-com-prometheus-client-golang
299 go-github-com-prometheus-common
300 go-github-com-prometheus-exporter-toolkit
301 go-github-com-prometheus-sigv4
302 go-github-com-rs-cors
303 go-github-com-shurcool-httpfs
304 go-github-com-shurcool-vfsgen
305 go-github-com-xlab-treeprint
306 go-go-opentelemetry-io-contrib-instrumentation-net-http-httptrace-otelhttptrace
307 go-go-opentelemetry-io-contrib-instrumentation-net-http-otelhttp
308 go-go-opentelemetry-io-otel
309 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace
310 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace-otlptracegrpc
311 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace-otlptracehttp
312 go-go-opentelemetry-io-otel-sdk
313 go-go-opentelemetry-io-otel-trace
314 go-go-uber-org-automaxprocs
315 go-golang-org-x-mod
316 go-golang-org-x-net
317 go-golang-org-x-text
318 go-golang-org-x-tools
319 go-google-golang-org-grpc
320 go-gopkg-in-telebot-v3
321 go-gopkg-in-yaml-v2))
322 (home-page "https://github.com/prometheus/alertmanager")
323 (synopsis "Prometheus Alertmanager")
324 (description
325 "The Alertmanager handles alerts sent by client applications such as the
326Prometheus server. It takes care of deduplicating, grouping, and routing them
327to the correct
328@url{https://prometheus.io/docs/alerting/latest/configuration/#receiver,
329receiver integrations} such as email, @code{PagerDuty}, @code{OpsGenie}, or
330many other
331@url{https://prometheus.io/docs/operating/integrations/#alertmanager-webhook-receiver,
332mechanisms} thanks to the webhook receiver. It also takes care of silencing
333and inhibition of alerts.")
334 (license license:asl2.0)))
335
336(define-public go-github-com-prometheus-client-golang
337 (package
338 (name "go-github-com-prometheus-client-golang")
339 (version "1.23.2")
340 (source
341 (origin
342 (method git-fetch)
343 (uri (git-reference
344 (url "https://github.com/prometheus/client_golang")
345 (commit (string-append "v" version))))
346 (file-name (git-file-name name version))
347 (sha256
348 (base32 "054hdlyjkyna1xx39apl7srzvjsyirnn1ihbaqarxbygdrz3zrx1"))))
349 (build-system go-build-system)
350 (arguments
351 (list
352 #:go go-1.24
353 #:skip-build? #t
354 ;; XXX: Check if the most of the tests may be enabled:
355 ;; api/prometheus/v1/api_test.go:1063:23: cannot use 1634644800304
356 ;; (untyped int constant) as int value in map literal (overflows)
357 #:tests? (target-64bit?)
358 #:import-path "github.com/prometheus/client_golang"
359 #:test-flags
360 #~(list "-skip"
361 (string-join
362 (list
363 ;; go_collector_latest_test.go:131: found unexpected metric
364 ;; go_godebug_non_default_behavior_httpcookiemaxnum_events_total
365 "TestGoCollector_ExposedMetrics"
366 ;; Tests fail with message: found new runtime/metrics
367 ;; metric
368 ;; /godebug/non-default-behavior/httpcookiemaxnum:events
369 ;; a new Go version may have been detected, please run go
370 ;; run gen_go_collector_metrics_set.go go1.X where X is
371 ;; the Go version you are currently using
372 "TestExpectedRuntimeMetrics"
373 ;; Assertions are not equal to compare strings.
374 "TestGoCollectorAllowList/allow_all"
375 "TestGoCollectorAllowList/allow_debug"
376 ;; Test fails on aarch64-linux system.
377 #$@(if (not (target-x86-64?))
378 '("TestProcessCollector")
379 '()))
380 "|"))
381 #:phases
382 #~(modify-phases %standard-phases
383 (add-after 'unpack 'remove-examples-and-tutorials
384 (lambda* (#:key import-path #:allow-other-keys)
385 (with-directory-excursion (string-append "src/" import-path)
386 (for-each delete-file-recursively
387 (list "api/prometheus/v1/example_test.go"
388 "examples"
389 "tutorials"))))))))
390 (native-inputs
391 (list go-github-com-google-go-cmp
392 go-go-uber-org-goleak))
393 (propagated-inputs
394 (list go-github-com-beorn7-perks
395 go-github-com-cespare-xxhash-v2
396 go-github-com-json-iterator-go
397 go-github-com-klauspost-compress
398 go-github-com-kylelemons-godebug
399 go-github-com-prometheus-client-model
400 go-github-com-prometheus-common
401 go-github-com-prometheus-procfs
402 go-golang-org-x-sys
403 go-google-golang-org-protobuf))
404 (home-page "https://github.com/prometheus/client_golang")
405 (synopsis "HTTP server and client tools for Prometheus")
406 (description
407 "This package @code{promhttp} provides HTTP client and server tools for
408Prometheus metrics.")
409 (license license:asl2.0)))
410
411(define-public go-github-com-prometheus-client-model
412 (package
413 (name "go-github-com-prometheus-client-model")
414 (version "0.6.2")
415 (source
416 (origin
417 (method git-fetch)
418 (uri (git-reference
419 (url "https://github.com/prometheus/client_model")
420 (commit (string-append "v" version))))
421 (file-name (git-file-name name version))
422 (sha256
423 (base32 "1r0magjb44ckin8mrp6shihbl7lvsswfry4hr9yr6d12zzm638db"))))
424 (build-system go-build-system)
425 (arguments
426 (list
427 ;; TODO: Check if need/can generare *.go from proto files, see Makefile.
428 #:skip-build? #t
429 #:import-path "github.com/prometheus/client_model"))
430 (propagated-inputs
431 (list go-github-com-golang-protobuf))
432 (home-page "https://github.com/prometheus/client_model")
433 (synopsis "Data model artifacts for Prometheus")
434 (description
435 "This package provides data model artifacts for Prometheus.")
436 (license license:asl2.0)))
437
438(define-public go-github-com-prometheus-common
439 (package
440 (name "go-github-com-prometheus-common")
441 (version "0.67.5")
442 (source
443 (origin
444 (method git-fetch)
445 (uri (git-reference
446 (url "https://github.com/prometheus/common")
447 (commit (string-append "v" version))))
448 (file-name (git-file-name name version))
449 (sha256
450 (base32 "0bkv73aq8ryaybvya1x5i2gvl5iffiysw5viagcrvak7ffrb09wp"))
451 (modules '((guix build utils)))
452 (snippet
453 #~(begin
454 ;; Submodules with their own go.mod files and packed as
455 ;; separated packages:
456 ;;
457 ;; - github.com/prometheus/common/assets
458 (delete-file-recursively "assets")))))
459 (build-system go-build-system)
460 (arguments
461 (list
462 #:skip-build? #t
463 #:import-path "github.com/prometheus/common"
464 #:test-subdirs
465 #~(list
466 ;; Skip, as it requires
467 ;; <github.com/prometheus/client_golang/prometheus>, which introduces
468 ;; cycle.
469 ;; "./config/..."
470
471 ;; Some tests fail on non x86_64 architecture: Cannot use 9223372036
472 ;; (untyped int constant) as int value in ;; struct literal
473 ;; (overflows). Cannot use math.MaxInt64 (untyped int constant
474 ;; 9223372036854775807) as int value in argument to HumanizeTimestamp
475 ;; (overflows)
476 #$@(if (target-x86-64?)
477 '("./helpers/...")
478 '())
479 "./expfmt/..."
480 "./model/..."
481 "./promlog/..."
482 "./route/..."
483 "./server/...")))
484 (native-inputs
485 (list go-github-com-google-go-cmp
486 go-github-com-stretchr-testify))
487 (propagated-inputs
488 (list go-github-com-alecthomas-kingpin-v2
489 go-github-com-golang-jwt-jwt-v5
490 go-github-com-google-uuid
491 go-github-com-julienschmidt-httprouter
492 go-github-com-munnerz-goautoneg
493 go-github-com-mwitkow-go-conntrack
494 go-github-com-prometheus-client-model
495 go-go-yaml-in-yaml-v2
496 go-golang-org-x-net
497 go-golang-org-x-oauth2
498 go-google-golang-org-protobuf))
499 (home-page "https://github.com/prometheus/common")
500 (synopsis "Shared Prometheus Golang components")
501 (description
502 "This package provides Go libraries that are shared across Prometheus
503components.
504
505@itemize
506@item @code{config} - common configuration structures
507@item @code{expfmt} - decoding and encoding for the exposition format
508@item @code{model} - shared data structures
509@item @code{promslog} - a logging wrapper around log/slog
510@item @code{route} - a routing wrapper around httprouter using context.Context
511@item @code{server} - common servers
512@item @code{version} version information and metrics
513@end itemize")
514 (license license:asl2.0)))
515
516(define-public go-github-com-prometheus-common-assets
517 (package
518 (name "go-github-com-prometheus-common-assets")
519 (version "0.2.0")
520 (source
521 (origin
522 (method git-fetch)
523 (uri (git-reference
524 (url "https://github.com/prometheus/common")
525 (commit (go-version->git-ref version
526 #:subdir "assets"))))
527 (file-name (git-file-name name version))
528 (sha256
529 (base32 "0r7sym4yaysbkc5anyypl57v9ay0a1flq00j85j7lcficl2scwrs"))))
530 (build-system go-build-system)
531 (arguments
532 (list
533 #:import-path "github.com/prometheus/common/assets"
534 #:unpack-path "github.com/prometheus/common"))
535 (home-page "https://github.com/prometheus/common")
536 (synopsis "Prometheus assets")
537 (description
538 "This package provides Prometheus assets.")
539 (license license:asl2.0)))
540
541(define-public go-github-com-prometheus-community-pro-bing
542 (package
543 (name "go-github-com-prometheus-community-pro-bing")
544 (version "0.5.0")
545 (source
546 (origin
547 (method git-fetch)
548 (uri (git-reference
549 (url "https://github.com/prometheus-community/pro-bing")
550 (commit (string-append "v" version))))
551 (file-name (git-file-name name version))
552 (sha256
553 (base32 "19757nqz0cpq7ir2w5xgjxpblhmkpk0j7spfw4j68agavbx6hxpm"))))
554 (build-system go-build-system)
555 (arguments
556 (list
557 ;; Tests requiring network setup, and root access.
558 #:test-flags
559 #~(list "-skip"
560 (string-join
561 (list "TestNewPingerValid"
562 "TestSetIPAddr"
563 "TestSetInterfaceName"
564 "TestSetResolveTimeout")
565 "|"))
566 #:import-path "github.com/prometheus-community/pro-bing"))
567 (propagated-inputs
568 (list go-github-com-google-uuid
569 go-golang-org-x-net
570 go-golang-org-x-sync))
571 (home-page "https://github.com/prometheus-community/pro-bing")
572 (synopsis "Continuous probers Golang library")
573 (description
574 "This package implements @acronym{Internet Control Message
575Protocol,ICMP} echo (ping) functionality.")
576 (license license:expat)))
577
578(define-public go-github-com-prometheus-exporter-toolkit
579 (package
580 (name "go-github-com-prometheus-exporter-toolkit")
581 (version "0.13.2")
582 (source
583 (origin
584 (method git-fetch)
585 (uri (git-reference
586 (url "https://github.com/prometheus/exporter-toolkit")
587 (commit (string-append "v" version))))
588 (file-name (git-file-name name version))
589 (sha256
590 (base32 "05k4sfrc1zs96iprgnap0gd42vwfq47j6vg2bv83nckcv731gmiv"))))
591 (build-system go-build-system)
592 (arguments
593 (list
594 #:import-path "github.com/prometheus/exporter-toolkit"
595 #:phases
596 #~(modify-phases %standard-phases
597 ;; XXX: Workaround for go-build-system's lack of Go modules support.
598 (delete 'build)
599 (replace 'check
600 (lambda* (#:key tests? import-path #:allow-other-keys)
601 (when tests?
602 (with-directory-excursion (string-append "src/" import-path)
603 (invoke "go" "test" "-v"
604 "-skip" "TestServerBehaviour|TestConfigReloading"
605 "./..."))))))))
606 (native-inputs
607 (list go-google-golang-org-protobuf))
608 (propagated-inputs
609 (list go-github-com-alecthomas-kingpin-v2
610 go-github-com-coreos-go-systemd-v22
611 go-github-com-go-kit-log
612 go-github-com-mdlayher-vsock
613 ; Imported for go-github-com-prometheus-common to break the cycle.
614 go-github-com-prometheus-client-golang
615 go-github-com-prometheus-common
616 go-golang-org-x-crypto
617 go-golang-org-x-sync
618 go-gopkg-in-yaml-v2))
619 (home-page "https://github.com/prometheus/exporter-toolkit")
620 (synopsis "Utility package to build Prometheus exporters")
621 (description
622 "This package provides tooling to build Prometheus exporters")
623 (license license:asl2.0)))
624
625(define-public go-github-com-prometheus-otlptranslator
626 (package
627 (name "go-github-com-prometheus-otlptranslator")
628 (version "1.0.0")
629 (source
630 (origin
631 (method git-fetch)
632 (uri (git-reference
633 (url "https://github.com/prometheus/otlptranslator")
634 (commit (string-append "v" version))))
635 (file-name (git-file-name name version))
636 (sha256
637 (base32 "1naca6ima2bzf6yhb2w9favqx644c0q1y16jlb2na7s4bgr3107p"))))
638 (build-system go-build-system)
639 (arguments
640 (list
641 #:import-path "github.com/prometheus/otlptranslator"))
642 (home-page "https://github.com/prometheus/otlptranslator")
643 (synopsis "OTLP Prometheus Translator")
644 (description
645 "This package provides a functionality to convert
646@url{https://opentelemetry.io/docs/specs/otlp/, OTLP} metric and attribute
647names to @url{https://prometheus.io/, Prometheus-compliant} formats. This is
648an internal library for both Prometheus and Open Telemetry,")
649 (license license:asl2.0)))
650
651(define-public go-github-com-prometheus-procfs
652 (package
653 (name "go-github-com-prometheus-procfs")
654 (version "0.19.2")
655 (source
656 (origin
657 (method git-fetch)
658 (uri (git-reference
659 (url "https://github.com/prometheus/procfs")
660 (commit (string-append "v" version))))
661 (file-name (git-file-name name version))
662 (sha256
663 (base32 "1szpgj5w4bbrrjy7whpmaz0l05zkrzscg6nwkph8fajfq78aalvg"))))
664 (build-system go-build-system)
665 (arguments
666 (list
667 ;; XXX: Check if the most of the tests may be enabled on non x86_64
668 ;; architectures, disable for now: ./proc_stat_test.go:98:49: cannot use
669 ;; math.MinInt64 (untyped int constant -9223372036854775808) as int
670 ;; value in struct literal (overflows).
671 #:tests? (target-x86-64?)
672 #:import-path "github.com/prometheus/procfs"
673 #:phases
674 #~(modify-phases %standard-phases
675 (add-before 'check 'unpack-testdata
676 (lambda* (#:key tests? import-path #:allow-other-keys)
677 (with-directory-excursion (string-append "src/" import-path)
678 (invoke "./ttar" "-C" "testdata/" "-x" "-f" "testdata/fixtures.ttar"))))
679 (add-after 'check 'remove-testdata
680 (lambda* (#:key tests? import-path #:allow-other-keys)
681 (with-directory-excursion (string-append "src/" import-path)
682 (delete-file-recursively "testdata")))))))
683 (native-inputs
684 (list go-github-com-google-go-cmp))
685 (propagated-inputs
686 (list go-golang-org-x-sync
687 go-golang-org-x-sys))
688 (synopsis "Go library for reading @file{/proc}")
689 (home-page "https://github.com/prometheus/procfs")
690 (description
691 "The @code{procfs} Go package provides functions to retrieve system,
692kernel, and process metrics from the @file{/proc} pseudo file system.")
693 (license license:asl2.0)))
694
695(define-public go-github-com-prometheus-sigv4
696 (package
697 (name "go-github-com-prometheus-sigv4")
698 (version "0.1.2")
699 (source
700 (origin
701 (method git-fetch)
702 (uri (git-reference
703 (url "https://github.com/prometheus/sigv4")
704 (commit (string-append "v" version))))
705 (file-name (git-file-name name version))
706 (sha256
707 (base32 "0yw37lw4x2l20l02i6yd4m4x948vgrfyaa0csl155rdyq3ynwa5w"))))
708 (build-system go-build-system)
709 (arguments
710 (list
711 #:import-path "github.com/prometheus/sigv4"))
712 (native-inputs
713 (list go-github-com-stretchr-testify))
714 (propagated-inputs
715 (list go-github-com-aws-aws-sdk-go
716 go-github-com-prometheus-client-golang
717 go-github-com-prometheus-common
718 go-gopkg-in-yaml-v2))
719 (home-page "https://github.com/prometheus/sigv4")
720 (synopsis "HTTP signed requests with Amazon's Signature Verification V4")
721 (description
722 "sigv4 provides a @code{http.RoundTripper} that will sign requests using
723Amazon's Signature Verification V4 signing procedure, using credentials from
724the default AWS credential chain.")
725 (license license:asl2.0)))
726
727(define-public go-github-com-prometheus-statsd-exporter
728 (package
729 (name "go-github-com-prometheus-statsd-exporter")
730 (version "0.28.0")
731 (source
732 (origin
733 (method git-fetch)
734 (uri (git-reference
735 (url "https://github.com/prometheus/statsd_exporter")
736 (commit (string-append "v" version))))
737 (file-name (git-file-name name version))
738 (sha256
739 (base32 "0h7ypmsx1j6x1p5wdj03i3jzwms7ab03asn2capl1gg6x07k57w7"))))
740 (build-system go-build-system)
741 (arguments
742 (list
743 #:import-path "github.com/prometheus/statsd_exporter"
744 #:embed-files #~(list "landing_page.css" "landing_page.html")))
745 (native-inputs
746 (list go-github-com-stvp-go-udp-testing))
747 (propagated-inputs
748 (list go-github-com-alecthomas-kingpin-v2
749 go-github-com-go-kit-log
750 go-github-com-golang-groupcache
751 go-github-com-prometheus-client-golang
752 go-github-com-prometheus-client-model
753 go-github-com-prometheus-common
754 go-github-com-prometheus-exporter-toolkit
755 go-gopkg-in-yaml-v2))
756 (home-page "https://github.com/prometheus/statsd_exporter")
757 (synopsis "StatsD to Prometheus metrics exporter")
758 (description
759 "The StatsD exporter is a drop-in replacement for
760@url{https://github.com/statsd/statsd,StatsD}. The exporter translates StatsD
761metrics to Prometheus metrics via configured mapping rules. This package
762provides a Golang module and @code{statsd_exporter} executable command.")
763 (license license:asl2.0)))
764
765(define-public go-github-com-sourcegraph-mountinfo
766 (package
767 (name "go-github-com-sourcegraph-mountinfo")
768 (properties '((commit . "e539465d544015a75056b3c77da212861cf7c223")
769 (revision . "0")
770 (go-pseudo-version . "0.0.0-20260429092751-e539465d5440")))
771 (version (git-version "0.0.0"
772 (assoc-ref properties 'revision)
773 (assoc-ref properties 'commit)))
774 (source
775 (origin
776 (method git-fetch)
777 (uri (git-reference
778 (url "https://github.com/sourcegraph/mountinfo")
779 (commit (assoc-ref properties 'commit))))
780 (file-name (git-file-name name version))
781 (sha256
782 (base32 "0izpsrkzxdw3b12wxgdah8c6klbddkryzcawd7fvvdwrcl7bsxjn"))))
783 (build-system go-build-system)
784 (arguments
785 (list
786 #:import-path "github.com/sourcegraph/mountinfo"
787 #:test-flags
788 #~(list "-skip" (string-join
789 ;; findSysfsMountpoint: no sysfs mountpoint found
790 (list "Test_DeviceName_VirtualFilesystem"
791 "Test_DeviceName_SmokeTest")
792 "|"))))
793 (native-inputs
794 (list go-github-com-google-go-cmp))
795 (propagated-inputs
796 (list go-github-com-moby-sys-mountinfo
797 go-github-com-prometheus-client-golang
798 go-github-com-sourcegraph-log
799 go-golang-org-x-sys))
800 (home-page "https://github.com/sourcegraph/mountinfo")
801 (synopsis "Prometheus info metric for advertizing block device names")
802 (description
803 "Package mountinfo provides a Prometheus collector that advertises the
804names of block storage devices backing the requested file paths.")
805 (license license:asl2.0)))
806
807(define-public go-github-com-yeya24-promlinter
808 (package
809 (name "go-github-com-yeya24-promlinter")
810 (version "0.3.0")
811 (source
812 (origin
813 (method git-fetch)
814 (uri (git-reference
815 (url "https://github.com/yeya24/promlinter")
816 (commit (string-append "v" version))))
817 (file-name (git-file-name name version))
818 (sha256
819 (base32 "0flmi0adwqhr6cbq2l73sngwpri37gdmi74lymz0w382pwhfyri1"))))
820 (build-system go-build-system)
821 (arguments
822 (list
823 #:import-path "github.com/yeya24/promlinter"))
824 (native-inputs
825 (list go-github-com-stretchr-testify))
826 (propagated-inputs
827 (list go-github-com-prometheus-client-golang
828 go-github-com-prometheus-client-model
829 go-gopkg-in-alecthomas-kingpin-v2
830 go-gopkg-in-yaml-v2))
831 (home-page "https://github.com/yeya24/promlinter")
832 (synopsis "Go linter for Prometheus metrics")
833 (description
834 "This package provides a linter for checking Prometheus metrics name via
835promlint.")
836 (license license:asl2.0)))
837
838;;;
839;;; Executables:
840;;;
841
842(define-public prometheus-alertmanager
843 (package/inherit go-github-com-prometheus-alertmanager
844 (name "prometheus-alertmanager")
845 (arguments
846 (substitute-keyword-arguments arguments
847 ((#:import-path _)
848 "github.com/prometheus/alertmanager/cmd/alertmanager")
849 ((#:install-source? _ #t) #f)
850 ((#:skip-build? _ #t) #f)
851 ((#:tests? _ #t) #f)))
852 (native-inputs
853 (package-propagated-inputs go-github-com-prometheus-alertmanager))
854 (propagated-inputs '())
855 (inputs '())))
856
857;;;
858;;; Avoid adding new packages to the end of this file. To reduce the chances
859;;; of a merge conflict, place them above in alphabetic order.
860;;;