def encodeEvent(self, event):
        pbevent = proto_pb2.Event(
            time=int(event.time),
            state=event.state,
            service=event.service,
            host=event.hostname,
            description=event.description,
            tags=event.tags,
            ttl=event.ttl,
        )

        if event.metric is not None:
            # I have no idea what I'm doing
            if isinstance(event.metric, int):
                pbevent.metric_sint64 = event.metric
                pbevent.metric_f = float(event.metric)
            else:
                pbevent.metric_d = float(event.metric)
                pbevent.metric_f = float(event.metric)
        if event.attributes is not None:
            for key, value in event.attributes.items():
                attribute = pbevent.attributes.add()
                attribute.key, attribute.value = key, value

        return pbevent
Add a collector to the registry.
dataset/ETHPy150Open calston/tensor/tensor/protocol/riemann.py/RiemannProtobufMixin.encodeEvent--crossover with--dataset/ETHPy150Open prometheus/client_python/prometheus_client/core.py/CollectorRegistry.register