In my expression, I need to access these fields in EvalMetricsSpec. How can I get them?
For interval, maybe use grain() from ExpressionEngineFunction.
If you are referring to the start and end fields in your EvalMetricSpec, maybe you can send those variables as bindings? EvalMetricSpec.bindings
Evaluate metric in a variable interval
Explore the expression engine functions now(), start(), and end().
In the context of a metric expression, they refer to the start and end of the currently computing time-slice
evalStart() for the evaluation start
evalEnd() for the evaluation end
evalInterval() for the evaluation interval
_context.extensions['metric'].src.id - for the source id