@Override
  public void start(CoprocessorEnvironment env) throws IOException {
    observer = new ExampleRegionObserverMeta();
    if (
      env instanceof RegionCoprocessorEnvironment
        && ((RegionCoprocessorEnvironment) env).getRegionInfo().getTable() != null
        && ((RegionCoprocessorEnvironment) env).getRegionInfo().getTable()
          .equals(TableName.META_TABLE_NAME)
    ) {
      RegionCoprocessorEnvironment regionCoprocessorEnv = (RegionCoprocessorEnvironment) env;
      registry = regionCoprocessorEnv.getMetricRegistryForRegionServer();
      LossyCounting.LossyCountingListener<String> listener = key -> {
        registry.remove(key);
        metrics.remove(key);
      };
      final Configuration conf = regionCoprocessorEnv.getConfiguration();
      clientMetricsLossyCounting = new LossyCounting<>("clientMetaMetrics", conf, listener);
      regionMetricsLossyCounting = new LossyCounting<>("regionMetaMetrics", conf, listener);
      // only be active mode when this region holds meta table.
      active = true;
    }
  }
Get regionId from Ops such as: get, put, delete.
@param op such as get, put or delete.
hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MetaTableMetrics.java