mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-07 09:17:49 +08:00
Some checks are pending
CodeQL / codeql (push) Waiting to run
Docker Check / lint (push) Waiting to run
Docker Check / build (push) Waiting to run
Gateway Conformance / gateway-conformance (push) Waiting to run
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Waiting to run
Go Build / go-build (push) Waiting to run
Go Check / go-check (push) Waiting to run
Go Lint / go-lint (push) Waiting to run
Go Test / go-test (push) Waiting to run
Interop / interop-prep (push) Waiting to run
Interop / helia-interop (push) Blocked by required conditions
Interop / ipfs-webui (push) Blocked by required conditions
Sharness / sharness-test (push) Waiting to run
Spell Check / spellcheck (push) Waiting to run
* refactor: consolidate Provider/Reprovider into unified Provide config - merge Provider and Reprovider configs into single Provide section - add fs-repo-17-to-18 migration for config consolidation - improve migration ergonomics with common package utilities - convert deprecated "flat" strategy to "all" during migration - improve Provide docs * docs: add total_provide_count metric guidance - document how to monitor provide success rates via prometheus metrics - add performance comparison section to changelog - explain how to evaluate sweep vs legacy provider effectiveness * fix: add OpenTelemetry meter provider for metrics - set up meter provider with Prometheus exporter in daemon - enables metrics from external libs like go-libp2p-kad-dht - fixes missing total_provide_count_total when SweepEnabled=true - update docs to reflect actual metric names --------- Co-authored-by: gammazero <11790789+gammazero@users.noreply.github.com> Co-authored-by: guillaumemichel <guillaume@michel.id> Co-authored-by: Daniel Norman <1992255+2color@users.noreply.github.com> Co-authored-by: Hector Sanjuan <code@hector.link>
56 lines
1.3 KiB
Go
56 lines
1.3 KiB
Go
package ipfs
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime"
|
|
)
|
|
|
|
// CurrentCommit is the current git commit, this is set as a ldflag in the Makefile.
|
|
var CurrentCommit string
|
|
|
|
// CurrentVersionNumber is the current application's version literal.
|
|
const CurrentVersionNumber = "0.38.0-dev"
|
|
|
|
const ApiVersion = "/kubo/" + CurrentVersionNumber + "/" //nolint
|
|
|
|
// RepoVersion is the version number that we are currently expecting to see.
|
|
const RepoVersion = 18
|
|
|
|
// GetUserAgentVersion is the libp2p user agent used by go-ipfs.
|
|
//
|
|
// Note: This will end in `/` when no commit is available. This is expected.
|
|
func GetUserAgentVersion() string {
|
|
userAgent := "kubo/" + CurrentVersionNumber + "/" + CurrentCommit
|
|
if userAgentSuffix != "" {
|
|
if CurrentCommit != "" {
|
|
userAgent += "/"
|
|
}
|
|
userAgent += userAgentSuffix
|
|
}
|
|
return userAgent
|
|
}
|
|
|
|
var userAgentSuffix string
|
|
|
|
func SetUserAgentSuffix(suffix string) {
|
|
userAgentSuffix = suffix
|
|
}
|
|
|
|
type VersionInfo struct {
|
|
Version string
|
|
Commit string
|
|
Repo string
|
|
System string
|
|
Golang string
|
|
}
|
|
|
|
func GetVersionInfo() *VersionInfo {
|
|
return &VersionInfo{
|
|
Version: CurrentVersionNumber,
|
|
Commit: CurrentCommit,
|
|
Repo: fmt.Sprint(RepoVersion),
|
|
System: runtime.GOARCH + "/" + runtime.GOOS, // TODO: Precise version here
|
|
Golang: runtime.Version(),
|
|
}
|
|
}
|