func (r *EventWatcher) Reconcile(req ctrl.Request) (ctrl.Result, error) {
	ctx := context.Background()
	log := r.Log.WithValues("event", req.NamespacedName)
	var event corev1.Event
	if err := r.Client.Get(ctx, req.NamespacedName, &event); err != nil {
		if isNotFound(err) {
			return ctrl.Result{}, nil
		}
		log.Error(err, "unable to fetch Event")
		return ctrl.Result{}, err
	}
	if eventTime(&event).Before(r.startTime.Add(-r.recent.recentWindow)) {
		return ctrl.Result{}, nil
	}
	r.captureObject(&event, "event")
	totalEventsNum.WithLabelValues(event.Type, event.InvolvedObject.Kind, event.Reason).Inc()
	adjustEventTime(&event, mtime.Now())
	err := r.handleEvent(ctx, &event)
	if err != nil {
		log.Error(err, "unable to handle event")
	}
	return ctrl.Result{}, nil
}
Reconcile gets called every time an Event changes
package events
import (
	"context"
	"errors"
	"io"
	"sync"
	"time"
	"github.com/go-logr/logr"
	"github.com/prometheus/client_golang/prometheus"
	tracesdk "go.opentelemetry.io/otel/sdk/export/trace"
	"go.opentelemetry.io/otel/sdk/resource"
	"go.opentelemetry.io/otel/semconv"
	"go.opentelemetry.io/otel/trace"
	corev1 "k8s.io/api/core/v1"
	apierrors "k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/api/meta"
	"k8s.io/apimachinery/pkg/runtime"
	ctrl "sigs.k8s.io/controller-runtime"
	"sigs.k8s.io/controller-runtime/pkg/client"
	"sigs.k8s.io/controller-runtime/pkg/metrics"
	"github.com/weaveworks-experiments/kspan/pkg/mtime"
)
var (
	noTrace = trace.NewSpanContext(trace.SpanContextConfig{})
)
type EventWatcher struct {
	sync.Mutex
	Client    client.Client
	Log       logr.Logger
	Exporter  tracesdk.SpanExporter
	Capture   io.Writer
	ticker    *time.Ticker
	startTime time.Time
	recent    *recentInfoStore
	pending   []*corev1.Event
	resources map[source]*resource.Resource
	outgoing  *outgoing
	scheme    *runtime.Scheme
}
type source struct {
	name     string
	instance string
}
var (
	totalEventsNum = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "kspan",
			Subsystem: "events",
			Name:      "total",
			Help:      "The total number of events.",
		},
		[]string{"type", "involved_object", "reason"})
)
func init() {
	metrics.Registry.MustRegister(totalEventsNum)
}