Internalized query context handling into MetricsMetaAPI implementation