I am observing N devices over a period of time $[0,T]$ and counting the number of certain events $y_j$, for each device, during that period of time. I also have some specifications $x_j$ for each device (explanatory variables). I was thinking of conducting Poisson regression on these data. However, I realized that some devices fail before the observation period ends.
Is it still valid to use Poisson regression? Can I include a dummy variable that indicates whether the device failed or not?