projects/guix·blob java-team · refs

1054 lines · 42.6 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-prometheus
696 (package
697 (name "go-github-com-prometheus-prometheus")
698 (version "0.308.0")
699 (source
700 (origin
701 (method git-fetch)
702 (uri (git-reference
703 (url "https://github.com/prometheus/prometheus")
704 (commit (string-append "v" version))))
705 (file-name (git-file-name name version))
706 (sha256
707 (base32 "1n9yl2mk9nz57g8k4jnwlqssfrky6ahkqk1fpx8bq36g0g3rj6w5"))
708 (modules '((guix build utils)))
709 (snippet
710 #~(begin
711 ;; Submodules with their own go.mod files and packaged separately.
712 (delete-file-recursively "documentation/examples/remote_storage")
713 (delete-file-recursively "web/ui/mantine-ui/src/promql/tools")))))
714 (build-system go-build-system)
715 (arguments
716 (list
717 #:skip-build? #t
718 #:import-path "github.com/prometheus/prometheus"
719 ;; XXX: Remove when all inputs are packaged.
720 #:test-subdirs
721 #~(list "schema" "template" "discovery" "tsdb/wlog" "util/pool"
722 "util/stats" "tsdb/chunks" "tsdb/errors" "tsdb/record"
723 "util/almost" "model/labels" "util/fmtutil" "util/logging"
724 "util/strutil" "discovery/aws" "discovery/dns" "discovery/xds"
725 "model/relabel" "model/rulefmt" "promql/parser" "tsdb/chunkenc"
726 "tsdb/fileutil" "tsdb/tsdbutil" "util/httputil" "util/junitxml"
727 "util/zeropool" "discovery/file" "discovery/http"
728 "discovery/moby" "tsdb/goversion" "discovery/uyuni"
729 "model/histogram" "model/textparse" "prompb/rwcommon"
730 "tsdb/tombstones" "discovery/eureka" "discovery/triton"
731 "util/compression" "util/convertnhcb" "discovery/hetzner"
732 "discovery/refresh" "util/netconnlimit" "discovery/marathon"
733 "discovery/puppetdb" "util/notifications" "discovery/kubernetes"
734 "discovery/targetgroup" "discovery/digitalocean"
735 "storage/remote/azuread" "util/namevalidationutil"
736 "prompb/io/prometheus/client" "prompb/io/prometheus/write/v2"
737 "documentation/examples/custom-sd/adapter")))
738 (native-inputs
739 ;; Tests and application dependency keep here.
740 (list go-github-com-google-go-cmp
741 go-github-com-google-pprof
742 go-github-com-kimmachinegun-automemlimit
743 go-github-com-oklog-run
744 go-github-com-stretchr-testify
745 go-go-uber-org-automaxprocs
746 go-go-uber-org-goleak
747 go-k8s-io-klog-v2
748 ;; go-github-com-nsf-jsondiff
749 #;go-k8s-io-klog))
750 (propagated-inputs
751 (list go-github-com-alecthomas-kingpin-v2
752 go-github-com-alecthomas-units
753 go-github-com-aws-aws-sdk-go-v2
754 go-github-com-aws-aws-sdk-go-v2
755 go-github-com-aws-aws-sdk-go-v2-config
756 go-github-com-aws-aws-sdk-go-v2-credentials
757 go-github-com-aws-aws-sdk-go-v2-feature-ec2-imds
758 go-github-com-aws-aws-sdk-go-v2-service-sts
759 go-github-com-aws-smithy-go
760 go-github-com-azure-azure-sdk-for-go-sdk-azcore
761 go-github-com-azure-azure-sdk-for-go-sdk-azidentity
762 go-github-com-cespare-xxhash-v2
763 go-github-com-code-hex-go-generics-cache
764 go-github-com-dennwc-varint
765 go-github-com-digitalocean-godo
766 go-github-com-docker-docker
767 go-github-com-edsrzf-mmap-go
768 go-github-com-envoyproxy-go-control-plane-envoy
769 go-github-com-envoyproxy-protoc-gen-validate
770 go-github-com-facette-natsort
771 go-github-com-fsnotify-fsnotify
772 go-github-com-go-openapi-strfmt
773 go-github-com-gogo-protobuf
774 go-github-com-golang-snappy
775 go-github-com-google-uuid
776 go-github-com-grafana-regexp
777 go-github-com-hetznercloud-hcloud-go-v2
778 go-github-com-json-iterator-go
779 go-github-com-klauspost-compress
780 go-github-com-kolo-xmlrpc
781 go-github-com-miekg-dns
782 go-github-com-munnerz-goautoneg
783 go-github-com-mwitkow-go-conntrack
784 go-github-com-oklog-ulid-v2
785 go-github-com-prometheus-alertmanager
786 go-github-com-prometheus-client-golang
787 go-github-com-prometheus-client-model
788 go-github-com-prometheus-common
789 go-github-com-prometheus-common-assets
790 go-github-com-prometheus-exporter-toolkit
791 go-github-com-prometheus-otlptranslator
792 go-github-com-prometheus-sigv4
793 go-github-com-shurcool-httpfs
794 go-go-opentelemetry-io-contrib-instrumentation-net-http-httptrace-otelhttptrace
795 go-go-opentelemetry-io-contrib-instrumentation-net-http-otelhttp
796 go-go-opentelemetry-io-otel
797 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace
798 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace-otlptracegrpc
799 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace-otlptracehttp
800 go-go-opentelemetry-io-otel-metric
801 go-go-opentelemetry-io-otel-sdk
802 go-go-opentelemetry-io-otel-trace
803 go-go-uber-org-atomic
804 go-go-uber-org-multierr
805 go-go-yaml-in-yaml-v2
806 go-golang-org-x-oauth2
807 go-golang-org-x-sync
808 go-golang-org-x-sys
809 go-golang-org-x-text
810 go-google-golang-org-api
811 go-google-golang-org-genproto-googleapis-api
812 go-google-golang-org-grpc
813 go-google-golang-org-protobuf
814 go-gopkg-in-yaml-v3
815 go-k8s-io-api
816 go-k8s-io-apimachinery
817 go-k8s-io-client-go
818
819 ;; TODO: Complete packaging.
820 ;; go-github-com-aws-aws-sdk-go-v2-service-ec2
821 ;; go-github-com-aws-aws-sdk-go-v2-service-ecs
822 ;; go-github-com-aws-aws-sdk-go-v2-service-lightsail
823 ;; go-github-com-azure-azure-sdk-for-go-sdk-resourcemanager-compute-armcompute-v5
824 ;; go-github-com-azure-azure-sdk-for-go-sdk-resourcemanager-network-armnetwork-v4
825 ;; go-github-com-bboreham-go-loser
826 ;; go-github-com-go-zookeeper-zk
827 ;; go-github-com-gophercloud-gophercloud-v2
828 ;; go-github-com-hashicorp-consul-api
829 ;; go-github-com-hashicorp-nomad-api
830 ;; go-github-com-ionos-cloud-sdk-go-v6
831 ;; go-github-com-linode-linodego
832 ;; go-github-com-open-telemetry-opentelemetry-collector-contrib-processor-deltatocumulativeprocessor
833 ;; go-github-com-ovh-go-ovh
834 ;; go-github-com-prometheus-client-golang-exp
835 ;; go-github-com-scaleway-scaleway-sdk-go
836 ;; go-github-com-stackitcloud-stackit-sdk-go-core
837 ;; go-github-com-vultr-govultr-v2
838 ;; go-go-opentelemetry-io-collector-component
839 ;; go-go-opentelemetry-io-collector-consumer
840 ;; go-go-opentelemetry-io-collector-pdata
841 ;; go-go-opentelemetry-io-collector-processor
842 ;; go-go-opentelemetry-io-collector-semconv
843 #;go-k8s-io-klog))
844 (home-page "https://github.com/prometheus/prometheus")
845 (synopsis "Monitoring system and time series database")
846 (description
847 "This package, a Cloud Native Computing Foundation project, is a systems and
848service monitoring system. It collects metrics from configured targets at
849given intervals, evaluates rule expressions, displays the results, and can
850trigger alerts when specified conditions are observed.")
851 (license license:asl2.0)
852 ;; XXX: Don't expose since it's a partial package.
853 (properties '((hidden? . #t)))))
854
855(define-public go-github-com-prometheus-sigv4
856 (package
857 (name "go-github-com-prometheus-sigv4")
858 (version "0.1.2")
859 (source
860 (origin
861 (method git-fetch)
862 (uri (git-reference
863 (url "https://github.com/prometheus/sigv4")
864 (commit (string-append "v" version))))
865 (file-name (git-file-name name version))
866 (sha256
867 (base32 "0yw37lw4x2l20l02i6yd4m4x948vgrfyaa0csl155rdyq3ynwa5w"))))
868 (build-system go-build-system)
869 (arguments
870 (list
871 #:import-path "github.com/prometheus/sigv4"))
872 (native-inputs
873 (list go-github-com-stretchr-testify))
874 (propagated-inputs
875 (list go-github-com-aws-aws-sdk-go
876 go-github-com-prometheus-client-golang
877 go-github-com-prometheus-common
878 go-gopkg-in-yaml-v2))
879 (home-page "https://github.com/prometheus/sigv4")
880 (synopsis "HTTP signed requests with Amazon's Signature Verification V4")
881 (description
882 "sigv4 provides a @code{http.RoundTripper} that will sign requests using
883Amazon's Signature Verification V4 signing procedure, using credentials from
884the default AWS credential chain.")
885 (license license:asl2.0)))
886
887(define-public go-github-com-prometheus-statsd-exporter
888 (package
889 (name "go-github-com-prometheus-statsd-exporter")
890 (version "0.28.0")
891 (source
892 (origin
893 (method git-fetch)
894 (uri (git-reference
895 (url "https://github.com/prometheus/statsd_exporter")
896 (commit (string-append "v" version))))
897 (file-name (git-file-name name version))
898 (sha256
899 (base32 "0h7ypmsx1j6x1p5wdj03i3jzwms7ab03asn2capl1gg6x07k57w7"))))
900 (build-system go-build-system)
901 (arguments
902 (list
903 #:import-path "github.com/prometheus/statsd_exporter"
904 #:embed-files #~(list "landing_page.css" "landing_page.html")))
905 (native-inputs
906 (list go-github-com-stvp-go-udp-testing))
907 (propagated-inputs
908 (list go-github-com-alecthomas-kingpin-v2
909 go-github-com-go-kit-log
910 go-github-com-golang-groupcache
911 go-github-com-prometheus-client-golang
912 go-github-com-prometheus-client-model
913 go-github-com-prometheus-common
914 go-github-com-prometheus-exporter-toolkit
915 go-gopkg-in-yaml-v2))
916 (home-page "https://github.com/prometheus/statsd_exporter")
917 (synopsis "StatsD to Prometheus metrics exporter")
918 (description
919 "The StatsD exporter is a drop-in replacement for
920@url{https://github.com/statsd/statsd,StatsD}. The exporter translates StatsD
921metrics to Prometheus metrics via configured mapping rules. This package
922provides a Golang module and @code{statsd_exporter} executable command.")
923 (license license:asl2.0)))
924
925(define-public go-github-com-sourcegraph-mountinfo
926 (package
927 (name "go-github-com-sourcegraph-mountinfo")
928 (properties '((commit . "e539465d544015a75056b3c77da212861cf7c223")
929 (revision . "0")
930 (go-pseudo-version . "0.0.0-20260429092751-e539465d5440")))
931 (version (git-version "0.0.0"
932 (assoc-ref properties 'revision)
933 (assoc-ref properties 'commit)))
934 (source
935 (origin
936 (method git-fetch)
937 (uri (git-reference
938 (url "https://github.com/sourcegraph/mountinfo")
939 (commit (assoc-ref properties 'commit))))
940 (file-name (git-file-name name version))
941 (sha256
942 (base32 "0izpsrkzxdw3b12wxgdah8c6klbddkryzcawd7fvvdwrcl7bsxjn"))))
943 (build-system go-build-system)
944 (arguments
945 (list
946 #:import-path "github.com/sourcegraph/mountinfo"
947 #:test-flags
948 #~(list "-skip" (string-join
949 ;; findSysfsMountpoint: no sysfs mountpoint found
950 (list "Test_DeviceName_VirtualFilesystem"
951 "Test_DeviceName_SmokeTest")
952 "|"))))
953 (native-inputs
954 (list go-github-com-google-go-cmp))
955 (propagated-inputs
956 (list go-github-com-moby-sys-mountinfo
957 go-github-com-prometheus-client-golang
958 go-github-com-sourcegraph-log
959 go-golang-org-x-sys))
960 (home-page "https://github.com/sourcegraph/mountinfo")
961 (synopsis "Prometheus info metric for advertizing block device names")
962 (description
963 "Package mountinfo provides a Prometheus collector that advertises the
964names of block storage devices backing the requested file paths.")
965 (license license:asl2.0)))
966
967(define-public go-github-com-yeya24-promlinter
968 (package
969 (name "go-github-com-yeya24-promlinter")
970 (version "0.3.0")
971 (source
972 (origin
973 (method git-fetch)
974 (uri (git-reference
975 (url "https://github.com/yeya24/promlinter")
976 (commit (string-append "v" version))))
977 (file-name (git-file-name name version))
978 (sha256
979 (base32 "0flmi0adwqhr6cbq2l73sngwpri37gdmi74lymz0w382pwhfyri1"))))
980 (build-system go-build-system)
981 (arguments
982 (list
983 #:import-path "github.com/yeya24/promlinter"))
984 (native-inputs
985 (list go-github-com-stretchr-testify))
986 (propagated-inputs
987 (list go-github-com-prometheus-client-golang
988 go-github-com-prometheus-client-model
989 go-gopkg-in-alecthomas-kingpin-v2
990 go-gopkg-in-yaml-v2))
991 (home-page "https://github.com/yeya24/promlinter")
992 (synopsis "Go linter for Prometheus metrics")
993 (description
994 "This package provides a linter for checking Prometheus metrics name via
995promlint.")
996 (license license:asl2.0)))
997
998(define-public go-go-opentelemetry-io-contrib-bridges-prometheus
999 (package
1000 (name "go-go-opentelemetry-io-contrib-bridges-prometheus")
1001 (version "0.69.0")
1002 (source
1003 (origin
1004 (method git-fetch)
1005 (uri (git-reference
1006 (url "https://github.com/open-telemetry/opentelemetry-go-contrib")
1007 (commit (go-version->git-ref version
1008 #:subdir "bridges/prometheus"))))
1009 (file-name (git-file-name name version))
1010 (sha256
1011 (base32 "1bm680k5ckpzjpsqzxswsylc9gxiw2flwkjlwmvh6hs50bgbpyjl"))))
1012 (build-system go-build-system)
1013 (arguments
1014 (list
1015 #:import-path "go.opentelemetry.io/contrib/bridges/prometheus"
1016 #:unpack-path "go.opentelemetry.io/contrib"))
1017 (native-inputs
1018 (list go-github-com-stretchr-testify))
1019 (propagated-inputs
1020 (list go-github-com-prometheus-client-golang
1021 go-github-com-prometheus-client-model
1022 go-go-opentelemetry-io-otel
1023 go-go-opentelemetry-io-otel-sdk
1024 go-go-opentelemetry-io-otel-sdk-metric))
1025 (home-page "https://go.opentelemetry.io/contrib")
1026 (synopsis "Bridge from Prometheus to OpenTelemetry")
1027 (description
1028 "Package prometheus provides a bridge from Prometheus to
1029@code{OpenTelemetry}.")
1030 (license license:asl2.0)))
1031
1032;;;
1033;;; Executables:
1034;;;
1035
1036(define-public prometheus-alertmanager
1037 (package/inherit go-github-com-prometheus-alertmanager
1038 (name "prometheus-alertmanager")
1039 (arguments
1040 (substitute-keyword-arguments arguments
1041 ((#:import-path _)
1042 "github.com/prometheus/alertmanager/cmd/alertmanager")
1043 ((#:install-source? _ #t) #f)
1044 ((#:skip-build? _ #t) #f)
1045 ((#:tests? _ #t) #f)))
1046 (native-inputs
1047 (package-propagated-inputs go-github-com-prometheus-alertmanager))
1048 (propagated-inputs '())
1049 (inputs '())))
1050
1051;;;
1052;;; Avoid adding new packages to the end of this file. To reduce the chances
1053;;; of a merge conflict, place them above in alphabetic order.
1054;;;