-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OM-147 Major change with refactoring, OTel support, System metrics (#104
) Added key System info metrics - memory, file-descriptors, network receive/transmit etc., - can be enabled/disabled in ape.toml using flag "refresh_system_stats" Added config to fetch additional cloud provider metrics - region, location, availability-zone - details can be fetch by providing "cloud_provider" in ape.toml - supported cloud-provider values are "aws", "azure", "gcp" Aligned and Cleaned up configs - removed job allowlist/blocklist - as support for job is removed in this release of exporter Fixed logic on actual stat-name returned by server, instead of the intermediate/constructed stat-names - storage-engine.file, storage-engine.stripe etc., are impacted Modified the Makefile and GitHub Action script to include tar.gz artefact Added support for native OpenTelemetry, - default mode is "Prometheus" - OTel can be enabled/disabled using flag "OPEN_TELEMETRY" in ape.toml - both Prometheus and OTel can run together in single exporter instance - added a configuration section for OTel configd in ape.toml under "Agent.OepnTelemetry" section - currently supports only gRPC based OTel end-points, like OTelCollector Aligned code according to golang standard package structure README.md is updated with required corrections and changes
- Loading branch information
Showing
88 changed files
with
11,084 additions
and
5,195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/aerospike/aerospike-prometheus-exporter/internal/pkg/config" | ||
"github.com/aerospike/aerospike-prometheus-exporter/internal/pkg/executors" | ||
|
||
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
var ( | ||
configFile = flag.String("config", "/etc/aerospike-prometheus-exporter/ape.toml", "Config File") | ||
showUsage = flag.Bool("u", false, "Show usage information") | ||
showVersion = flag.Bool("version", false, "Print version") | ||
|
||
version = "v1.9.0" | ||
|
||
// Gauge related | ||
// | ||
gaugeStatsFile = flag.String("gauge-list", "/etc/aerospike-prometheus-exporter/gauge_stats_list.toml", "Gauge stats File") | ||
// gaugeStatHandler *GaugeStats | ||
) | ||
|
||
func main() { | ||
log.Infof("Welcome to Aerospike Prometheus Exporter %s", version) | ||
parseCommandlineArgs() | ||
|
||
// initialize configs and gauge-stats | ||
config.InitConfig(*configFile) | ||
config.InitGaugeStats(*gaugeStatsFile) | ||
|
||
if config.Cfg.Agent.PrometheusEnabled { | ||
startExecutor("prometheus") | ||
} | ||
if config.Cfg.Agent.OtelEnabled { | ||
startExecutor("otel") | ||
} | ||
|
||
select {} | ||
} | ||
|
||
func startExecutor(mode string) { | ||
metric_handlers := executors.GetExecutors() | ||
|
||
processor := metric_handlers[mode] | ||
log.Infof("Starting metrics serving mode with '%s'", mode) | ||
if processor != nil { | ||
// start processor in a separate thread | ||
go func() { | ||
err := processor.Initialize() | ||
if err != nil { | ||
fmt.Println("Error while Initializing Processor ", err) | ||
} | ||
}() | ||
} | ||
} | ||
|
||
func parseCommandlineArgs() { | ||
flag.Parse() | ||
if *showUsage { | ||
flag.Usage() | ||
os.Exit(0) | ||
} | ||
|
||
if *showVersion { | ||
fmt.Println(version) | ||
os.Exit(0) | ||
} | ||
} |
Oops, something went wrong.