engine.go
engine.go - Overview
-
Overview This file defines a function
NewEngine
that creates and configures a Prometheus query engine (promql.Engine
). It also initializes the Prometheus model to use UTF8 validation. -
Detailed Documentation
Function: NewEngine
- Purpose: Creates a new Prometheus query engine with the specified configuration.
- Parameters:
logger
(*slog.Logger): A logger for the engine to use.cfg
(Config): Configuration parameters for the engine, including active query tracker settings.
- Returns:
*Engine
(*promql.Engine): A pointer to the newly created and configured Prometheus query engine.
Function: init
- Purpose: Initializes the Prometheus model's name validation scheme to UTF8 validation. This ensures that metric names and label names adhere to UTF8 encoding.
- Parameters: None
- Returns: None
-
Code Examples None
-
Clarity and Accuracy The documentation is based directly on the code provided.
-
Markdown & MDX Perfection The markdown is properly formatted.
-
Edge Cases To Avoid Breaking MDX All potential breaking characters are properly escaped or enclosed in code blocks.
-
Getting Started Relevance Include in Getting Started: NO