Usually, a "damage roll" is considered as "all the dice rolls and damage bonuses that the attack describes". In a simple case, you'd simply do the 1 + 3d4 first and then add the proficiency bonus that corresponds to your level. At first level, that's (1 + 3d4) + 2 .
However, in case of resistances, things get a little complicated. If the target is resistant to poison but not to piercing, how much damage does it take?
The PHB doesn't say anything on the topic. The only similar thing I've found is for things like "3d4 piercing and poison damage", in which case the target would have to have resistances for both effects for it to apply. Extending that logic, one could argue that you apply resistances for each damage type individually. But where does the proficiency bonus come into effect then?
I would say the issue is ambiguous enough that the final decision should fall with the DM and be maintained as a house rule. I would suggest the following rule based on my own reasoning:
The Ranger's proficiency bonus applies to the skill-based aspect of the beast's attack.
Effect: For this example, the snake's ability to bite is enhanced by the Ranger's ability to command it, therefore the piercing potion (the bite) is enhanced by the proficiency bonus while the poison damage (the snake's venom) is dealt as-is. For someone resistant to poison it means the target would take half of the 3d4 poison damage, but the full (1+proficiency) piercing damage.
Rationale: The Ranger's understanding of its snake companion and his ability to train and command it has made the companion more skillful with its attacks. However, the snake's body still produces the same venom as it would if the snake was just a wild animal. Therefore the bonus to the snake's damage should apply to the physical portion unless stated otherwise.
To further illustrate the point, let's consider a Fighter with a flaming sword that deals 2d6 slashing + 1d8 fire damage. When attacking he adds his Strength modifier to the damage. The Fighter's ability to wield a sword is what causes the Strength bonus, so the extra damage would naturally be applied to the slashing part. If a target is resistant to fire, it only resists the 1d8. The snake is similar, with its fangs as its weapon, the poison as the extra effect, and the Ranger's proficiency bonus as the added skill damage.
One could argue that a beast with a purely non-physical attack (e.g. breathing fire or spitting poison) should not receive the bonus. I would suggest that perhaps the Ranger trained the beast into using its natural resource more skillfully (e.g. aiming for the eyes) and that's why the bonus applies (as the original RAW rule intended).
One could also argue that if a damage roll has two types of physical attack that the bonus should apply to both. That would conflict with the RAW rule of "apply the bonus once per damage roll". I would probably assign the bonus to the first type. I haven't ever even heard of such an attack, though, and having a beast with such an attack AND an enemy with a resistance to one of the two is a situation that I'm sure will not arise often.
As the RAW rule intended, this effect is applied once per the beast's attack. That means that, although the snake's attack contains two damage types, it is still a single attack and gains the proficiency bonus once. If a beast can make multiple attacks as its action, though, it gains the bonus once per each attack, but it has to make an attack roll for each attack as well.
Alternative house rule
If the damage roll consists of multiple damage types and the target resists only one of them, apply the proficiency bonus to the non-resisted part of the damage. Only when the target resists all of the damage types that are part of the attack is the proficiency bonus included in the reduced damage calculation.
So, going back to the Flying Snake example, if the target resists poison, it's the same as the former rule: (1+proficiency) + (3d4)/2, rounded down.
If the target resists piercing instead, the proficiency bonus is now applied to the poison damage: 1/2 + (3d4 + proficiency). Because we round down, that means the piercing part is essentially nullified (which you could role-play as the bite was never felt, turning a resistance into a stealthy advantage).
Only if the target has both piercing and poison resistance is the attack fully resisted, and we go back to the standard ((1 + 3d4) + proficiency)/2, rounded down.
I like the first rule better for role-playing purposes, but this one is quick to resolve and doesn't require any consideration as to what a "skill-based aspect" of the attack is.